Plugins/CheckerPlugins/CodeStyleChecker/pep8.py

changeset 3210
8f4fe6f76729
parent 3160
209a07d7e401
child 3484
645c12de6b0c
--- a/Plugins/CheckerPlugins/CodeStyleChecker/pep8.py	Thu Jan 16 18:28:34 2014 +0100
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/pep8.py	Thu Jan 16 18:45:45 2014 +0100
@@ -68,6 +68,7 @@
 import inspect
 import keyword
 import tokenize
+import ast
 from optparse import OptionParser
 from fnmatch import fnmatch
 try:
@@ -93,7 +94,6 @@
     'pylint': '%(path)s:%(row)d: [%(code)s] %(text)s',
 }
 
-PyCF_ONLY_AST = 1024
 SINGLETONS = frozenset(['False', 'None', 'True'])
 KEYWORDS = frozenset(keyword.kwlist + ['print']) - SINGLETONS
 UNARY_OPERATORS = frozenset(['>>', '**', '*', '+', '-'])
@@ -1509,7 +1509,7 @@
 
     def check_ast(self):
         try:
-            tree = compile(''.join(self.lines), '', 'exec', PyCF_ONLY_AST)
+            tree = compile(''.join(self.lines), '', 'exec', ast.PyCF_ONLY_AST)
         except (SyntaxError, TypeError):
             return self.report_invalid_syntax()
         for name, cls, _ in self._ast_checks:

eric ide

mercurial