1. Masami HIRATA
  2. pyflakes3k

Commits

Masami HIRATA  committed 23e593b

Modified some nodes to support Python 3.3

See: $ hg diff -r v3.2.3 -r v3.3.0 Python\Python-ast.c

  • Participants
  • Parent commits 3567b2c
  • Branches support-python3.3

Comments (0)

Files changed (1)

File pyflakes/checker.py

View file
 
 import builtins
 import os.path
+import sys
 import ast
 
 from pyflakes import messages
         pass
 
     # "stmt" type nodes
-    RETURN = DELETE = PRINT = WHILE = IF = WITH = RAISE = TRYEXCEPT = \
-        TRYFINALLY = ASSERT = EXEC = EXPR = handleChildren
+    if sys.version_info < (3, 3):
+        RETURN = DELETE = PRINT = WHILE = IF = WITH = RAISE = TRYEXCEPT = \
+            TRYFINALLY = ASSERT = EXEC = EXPR = handleChildren
+    else:
+        RETURN = DELETE = PRINT = WHILE = IF = WITH = RAISE = TRY = ASSERT = \
+            EXEC = EXPR = handleChildren
+
 
     CONTINUE = BREAK = PASS = ignore
 
     # "expr" type nodes
-    BOOLOP = BINOP = UNARYOP = IFEXP = DICT = SET = YIELD = COMPARE = \
-    CALL = REPR = ATTRIBUTE = SUBSCRIPT = LIST = TUPLE = handleChildren
+    if sys.version_info < (3, 3):
+        BOOLOP = BINOP = UNARYOP = IFEXP = DICT = SET = YIELD = COMPARE = \
+            CALL = REPR = ATTRIBUTE = SUBSCRIPT = LIST = TUPLE = \
+            handleChildren
+    else:
+        BOOLOP = BINOP = UNARYOP = IFEXP = DICT = SET = YIELD = YIELDFROM = \
+            COMPARE = CALL = REPR = ATTRIBUTE = SUBSCRIPT = LIST = TUPLE = \
+            handleChildren
 
     NUM = STR = BYTES = ELLIPSIS = ignore
 
     EQ = NOTEQ = LT = LTE = GT = GTE = IS = ISNOT = IN = NOTIN = ignore
 
     # additional node types
-    COMPREHENSION = KEYWORD = handleChildren
+    if sys.version_info < (3, 3):
+        COMPREHENSION = KEYWORD = handleChildren
+    else:
+        COMPREHENSION = KEYWORD = WITHITEM = handleChildren
+
 
     def GLOBAL(self, node):
         """