From: Tim Newsome Date: Wed, 1 Nov 2017 19:36:36 +0000 (-0700) Subject: Make pylint 1.6.5 happy. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cc4fb603a4c6c1c1ba92262763b68bbb91092ed3;p=riscv-tests.git Make pylint 1.6.5 happy. --- diff --git a/debug/gdbserver.py b/debug/gdbserver.py index eabf445..f2c84ae 100755 --- a/debug/gdbserver.py +++ b/debug/gdbserver.py @@ -207,7 +207,7 @@ class MemTestBlock(GdbTest): self.gdb.command("dump ihex memory %s 0x%x 0x%x" % (b.name, self.hart.ram, self.hart.ram + self.length)) self.gdb.command("shell cat %s" % b.name) - for line in b: + for line in b.xreadlines(): record_type, address, line_data = ihex_parse(line) if record_type == 0: written_data = data[address:address+len(line_data)] diff --git a/debug/pylint.rc b/debug/pylint.rc index 193ea3a..8bbfe20 100644 --- a/debug/pylint.rc +++ b/debug/pylint.rc @@ -178,7 +178,7 @@ logging-modules=logging [BASIC] # Required attributes for module, separated by a comma -required-attributes= +#required-attributes= # List of builtins function names that should not be used, separated by a comma bad-functions=map,filter,apply,input,file @@ -287,7 +287,7 @@ int-import-graph= # List of interface methods to ignore, separated by a comma. This is used for # instance to not check methods defines in Zope's Interface base class. -ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by +#ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by # List of method names used to declare (i.e. assign) instance attributes. defining-attr-methods=__init__,__new__,setUp diff --git a/debug/targets.py b/debug/targets.py index 06688d8..eb6862b 100644 --- a/debug/targets.py +++ b/debug/targets.py @@ -173,7 +173,7 @@ def target(parsed): found = [] for name in dir(module): definition = getattr(module, name) - if type(definition) == type and issubclass(definition, Target): + if isinstance(definition, type) and issubclass(definition, Target): found.append(definition) assert len(found) == 1, "%s does not define exactly one subclass of " \ "targets.Target" % parsed.target diff --git a/debug/testlib.py b/debug/testlib.py index e1be100..fae2132 100644 --- a/debug/testlib.py +++ b/debug/testlib.py @@ -555,7 +555,7 @@ def run_all_tests(module, target, parsed): for name in dir(module): definition = getattr(module, name) - if type(definition) == type and hasattr(definition, 'test') and \ + if isinstance(definition, type) and hasattr(definition, 'test') and \ (not parsed.test or any(test in name for test in parsed.test)): todo.append((name, definition, None)) @@ -670,7 +670,6 @@ class BaseTest(object): compile_args = getattr(self, 'compile_args', None) if compile_args: if compile_args not in BaseTest.compiled: - # pylint: disable=star-args BaseTest.compiled[compile_args] = \ self.target.compile(self.hart, *compile_args) self.binary = BaseTest.compiled.get(compile_args)