Upgraded pyflakes to version 1.5.0

Wed, 08 Feb 2017 21:39:58 +0100

author
T.Rzepka <Tobias.Rzepka@gmail.com>
date
Wed, 08 Feb 2017 21:39:58 +0100
changeset 5510
cdcd0cd34e79
parent 5509
d4c4763b46ee
child 5511
54632671aa3b

Upgraded pyflakes to version 1.5.0

Plugins/CheckerPlugins/SyntaxChecker/pyflakes/__init__.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/SyntaxChecker/pyflakes/checker.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/SyntaxChecker/pyflakes/messages.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/SyntaxChecker/pyflakes/translations.py file | annotate | diff | comparison | revisions
changelog file | annotate | diff | comparison | revisions
--- a/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/__init__.py	Wed Feb 08 21:36:29 2017 +0100
+++ b/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/__init__.py	Wed Feb 08 21:39:58 2017 +0100
@@ -32,6 +32,19 @@
 """
 
 """ Changes
+1.5.0 (2017-01-09)
+  - Enable support for PEP 526 annotated assignments
+
+1.4.0 (2016-12-30):
+  - Change formatting of ImportStarMessage to be consistent with other errors
+  - Support PEP 498 "f-strings"
+
+1.3.0 (2016-09-01):
+  - Fix PyPy2 Windows IntegrationTests
+  - Check for duplicate dictionary keys
+  - Fix TestMain tests on Windows
+  - Fix "continue" and "break" checks ignoring py3.5's "async for" loop
+
 1.2.3 (2016-05-12):
   - Fix TypeError when processing relative imports
 
--- a/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/checker.py	Wed Feb 08 21:36:29 2017 +0100
+++ b/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/checker.py	Wed Feb 08 21:39:58 2017 +0100
@@ -311,7 +311,7 @@
 
 
 class StarImportation(Importation):
-    """A binding created by an 'from x import *' statement."""
+    """A binding created by a 'from x import *' statement."""
 
     def __init__(self, name, source):
         super(StarImportation, self).__init__('*', source)
@@ -806,7 +806,7 @@
             return
 
         if on_conditional_branch():
-            # We can not predict if this conditional branch is going to
+            # We cannot predict if this conditional branch is going to
             # be executed.
             return
 
@@ -944,7 +944,7 @@
         MATMULT = ignore
 
     # additional node types
-    COMPREHENSION = KEYWORD = FORMATTEDVALUE = handleChildren
+    COMPREHENSION = KEYWORD = FORMATTEDVALUE = JOINEDSTR = handleChildren
 
     def DICT(self, node):
         # Complain if there are duplicate keys with different values
@@ -1328,7 +1328,7 @@
         self.handleNodeStore(node)
         self.handleChildren(node)
         if not is_name_previously_defined:
-            # See discussion on https://github.com/pyflakes/pyflakes/pull/59.
+            # See discussion on https://github.com/PyCQA/pyflakes/pull/59
 
             # We're removing the local name since it's being unbound
             # after leaving the except: block and it's always unbound
@@ -1343,5 +1343,24 @@
             except KeyError:
                 pass
 
+    def ANNASSIGN(self, node):
+        """
+        Annotated assignments don't have annotations evaluated on function
+        scope, hence the custom implementation.
+
+        See: PEP 526.
+        """
+        if node.value:
+            # Only bind the *targets* if the assignment has a value.
+            # Otherwise it's not really ast.Store and shouldn't silence
+            # UndefinedLocal warnings.
+            self.handleNode(node.target, node)
+        if not isinstance(self.scope, FunctionScope):
+            self.handleNode(node.annotation, node)
+        if node.value:
+            # If the assignment has value, handle the *value* now.
+            self.handleNode(node.value, node)
+
+
 #
 # eflag: noqa = M702
--- a/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/messages.py	Wed Feb 08 21:36:29 2017 +0100
+++ b/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/messages.py	Wed Feb 08 21:39:58 2017 +0100
@@ -173,7 +173,7 @@
     Class defining the "Import Star Usage" message.
     """
     message_id = 'F17'
-    message = "%s may be undefined, or defined from star imports: %s"
+    message = "%r may be undefined, or defined from star imports: %s"
 
     def __init__(self, filename, loc, name, from_list):
         """
--- a/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/translations.py	Wed Feb 08 21:36:29 2017 +0100
+++ b/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/translations.py	Wed Feb 08 21:39:58 2017 +0100
@@ -65,7 +65,7 @@
         "'from {0} import *' only allowed at module level"),
     'F17': QCoreApplication.translate(
         'pyFlakes',
-        "{0} may be undefined, or defined from star imports: {1}"),
+        "{0!r} may be undefined, or defined from star imports: {1}"),
     'F18': QCoreApplication.translate(
         'pyFlakes',
         "Dictionary key {0!r} repeated with different values"),
--- a/changelog	Wed Feb 08 21:36:29 2017 +0100
+++ b/changelog	Wed Feb 08 21:39:58 2017 +0100
@@ -4,6 +4,7 @@
 - bug fixes
 - Checkers
   -- upgraded pycodestyle to version 2.3.1
+  -- upgraded pyflakes to version 1.5.0
   
 Version 17.02.1:
 - bug fixes

eric ide

mercurial