eric6/Plugins/CheckerPlugins/CodeStyleChecker/MiscellaneousChecker.py

changeset 7057
0e8d3b0c4889
parent 7045
c2bf08f87a1d
child 7245
b47179fbb9d8
diff -r 516361cdd2d2 -r 0e8d3b0c4889 eric6/Plugins/CheckerPlugins/CodeStyleChecker/MiscellaneousChecker.py
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/MiscellaneousChecker.py	Tue Jul 09 19:07:03 2019 +0200
+++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/MiscellaneousChecker.py	Tue Jul 09 19:08:24 2019 +0200
@@ -760,7 +760,12 @@
         for node in ast.walk(self.__tree):
             if any(isinstance(node, functionDef)
                    for functionDef in functionDefs):
-                for default in node.args.defaults + node.args.kw_defaults:
+                defaults = node.args.defaults[:]
+                try:
+                    defaults += node.args.kw_defaults[:]
+                except AttributeError:
+                    pass
+                for default in defaults:
                     if any(isinstance(default, mutableType)
                            for mutableType in mutableTypes):
                         typeName = type(default).__name__

eric ide

mercurial