A little change to py3flakes.

Thu, 12 Jan 2012 18:47:58 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 12 Jan 2012 18:47:58 +0100
changeset 1534
e5b76a5eda84
parent 1532
df0c2a045c72
child 1535
f2650ea19bb8

A little change to py3flakes.

Utilities/py3flakes/__init__.py file | annotate | diff | comparison | revisions
Utilities/py3flakes/checker.py file | annotate | diff | comparison | revisions
diff -r df0c2a045c72 -r e5b76a5eda84 Utilities/py3flakes/__init__.py
--- a/Utilities/py3flakes/__init__.py	Sun Jan 08 20:05:08 2012 +0100
+++ b/Utilities/py3flakes/__init__.py	Thu Jan 12 18:47:58 2012 +0100
@@ -7,4 +7,4 @@
 Package containg the pyflakes Python3 port adapted for Qt.
 """
 
-__version__ = '0.4.0'
+__version__ = '0.5.0'
diff -r df0c2a045c72 -r e5b76a5eda84 Utilities/py3flakes/checker.py
--- a/Utilities/py3flakes/checker.py	Sun Jan 08 20:05:08 2012 +0100
+++ b/Utilities/py3flakes/checker.py	Thu Jan 12 18:47:58 2012 +0100
@@ -2,10 +2,10 @@
 
 # Copyright (c) 2010 - 2012 Detlev Offenbach <detlev@die-offenbachs.de>
 #
-# Original (c) 2005-2008 Divmod, Inc.
+# Original (c) 2005-2010 Divmod, Inc.
 #
 # This module is based on pyflakes for Python2 but was heavily hacked to
-# work with Python3
+# work with Python3 and eric5
 
 import builtins
 import os.path
@@ -485,7 +485,7 @@
                 "Got impossible expression context: {0:r}".format(node.ctx,))
 
     def FUNCTIONDEF(self, node):
-        if getattr(node, "decorator_list", None) is not None:
+        if hasattr(node, "decorator_list"):
             for decorator in node.decorator_list:
                 self.handleNode(decorator, node)
         self.addBinding(node.lineno, FunctionDefinition(node.name, node))
@@ -542,9 +542,8 @@
         classes, and the body of its definition.  Additionally, add its name to
         the current scope.
         """
-        if getattr(node, "decorator_list", None) is not None:
-            for decorator in node.decorator_list:
-                self.handleNode(decorator, node)
+        for decorator in getattr(node, "decorator_list", []):
+            self.handleNode(decorator, node)
         for baseNode in node.bases:
             self.handleNode(baseNode, node)
         self.addBinding(node.lineno, Binding(node.name, node))

eric ide

mercurial