MiscChecker, ast: No special case for Python 2 needed.

Fri, 14 Apr 2017 18:22:28 +0200

author
T.Rzepka <Tobias.Rzepka@gmail.com>
date
Fri, 14 Apr 2017 18:22:28 +0200
changeset 5703
7650c11cc5f2
parent 5702
034a25f62777
child 5704
8edf2c154eca

MiscChecker, ast: No special case for Python 2 needed.

Plugins/CheckerPlugins/CodeStyleChecker/MiscellaneousChecker.py file | annotate | diff | comparison | revisions
diff -r 034a25f62777 -r 7650c11cc5f2 Plugins/CheckerPlugins/CodeStyleChecker/MiscellaneousChecker.py
--- a/Plugins/CheckerPlugins/CodeStyleChecker/MiscellaneousChecker.py	Wed Apr 12 19:52:56 2017 +0200
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/MiscellaneousChecker.py	Fri Apr 14 18:22:28 2017 +0200
@@ -605,10 +605,7 @@
                 for default in node.args.defaults:
                     if any(isinstance(default, mutableType)
                            for mutableType in mutableTypes):
-                        if sys.version_info[0] == 2:
-                            typeName = default.__name__
-                        else:
-                            typeName = type(default).__name__
+                        typeName = type(default).__name__
                         if isinstance(default, ast.Call):
                             errorCode = "M822"
                         else:

eric ide

mercurial