grim/pyparser

3bc331e49f6d
Parents 1d2ba805c8c7
Children b02051d4f18a
Don't use old style constructor chaining
--- a/tests/test_parser.py Fri Aug 12 11:04:41 2016 -0500
+++ b/tests/test_parser.py Fri Aug 12 11:09:27 2016 -0500
@@ -18,7 +18,7 @@
"""
def __init__(self):
- Parser.__init__(self)
+ super(CountingParser, self).__init__()
self.started = False
self.finished = False
@@ -96,7 +96,10 @@
"""
def __init__(self, strip):
- Parser.__init__(self, strip=strip, ignore_blanks=False)
+ super(WhiteSpaceParser, self).__init__(
+ strip=strip,
+ ignore_blanks=False
+ )
self.data = {'leading': 0, 'trailing': 0}
--- a/tests/test_regex.py Fri Aug 12 11:04:41 2016 -0500
+++ b/tests/test_regex.py Fri Aug 12 11:09:27 2016 -0500
@@ -18,7 +18,10 @@
class InvalidRegexParser(RegexParser):
""" A parser that has an invalid regular expression decorator """
def __init__(self, handle_errors):
- RegexParser.__init__(self, handle_errors=handle_errors)
+ super(InvalidRegexPatternTest.InvalidRegexParser, self).__init__(
+ self,
+ handle_errors=handle_errors
+ )
@pattern('(')
def _broken(self):
@@ -47,7 +50,7 @@
""" Parsers /proc/cpuinfo with kwargs """
def __init__(self):
- RegexParser.__init__(self, named_groups=True)
+ super(CPUInfoKWArgsParser, self).__init__(self, named_groups=True)
self.data = {}
self.processor = None
@@ -68,7 +71,7 @@
""" Parsers /proc/cpuinfo without kwargs """
def __init__(self):
- RegexParser.__init__(self)
+ super(CPUInfoMatchParser, self).__init__()
self.data = {}
self.processor = None