A little change to py3flakes. 5_1_x

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

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 12 Jan 2012 18:47:58 +0100
branch
5_1_x
changeset 1536
7d766369823d
parent 1533
087aa177764a
child 1537
acae49c8d343

A little change to py3flakes.
(transplanted from e5b76a5eda84f7f1495f9bc636adcd8303300c24)

Utilities/py3flakes/__init__.py file | annotate | diff | comparison | revisions
Utilities/py3flakes/checker.py file | annotate | diff | comparison | revisions
diff -r 087aa177764a -r 7d766369823d Utilities/py3flakes/__init__.py
--- a/Utilities/py3flakes/__init__.py	Sun Jan 08 20:07:13 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 087aa177764a -r 7d766369823d Utilities/py3flakes/checker.py
--- a/Utilities/py3flakes/checker.py	Sun Jan 08 20:07:13 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
@@ -472,7 +472,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))
@@ -529,9 +529,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