[Checkins] SVN: refline.srccheck/trunk/s Support newer pyflakes

Andrey Lebedev cvs-admin at zope.org
Fri Nov 16 11:33:50 UTC 2012


Log message for revision 128306:
  Support newer pyflakes
  
  Namely pyflakes-0.5.0
  
  

Changed:
  U   refline.srccheck/trunk/setup.py
  U   refline.srccheck/trunk/src/refline/srccheck/pyflakes.py

-=-
Modified: refline.srccheck/trunk/setup.py
===================================================================
--- refline.srccheck/trunk/setup.py	2012-11-16 00:56:51 UTC (rev 128305)
+++ refline.srccheck/trunk/setup.py	2012-11-16 11:33:49 UTC (rev 128306)
@@ -26,7 +26,7 @@
     url="http://pypi.python.org/pypi/refline.srccheck/",
     install_requires=[
         'setuptools',
-        'pyflakes == 0.4.0',  # pyflakes 0.5.0 does not like python 2.6's AST
+        'pyflakes', 
         'polib',
         'cssutils',
     ],

Modified: refline.srccheck/trunk/src/refline/srccheck/pyflakes.py
===================================================================
--- refline.srccheck/trunk/src/refline/srccheck/pyflakes.py	2012-11-16 00:56:51 UTC (rev 128305)
+++ refline.srccheck/trunk/src/refline/srccheck/pyflakes.py	2012-11-16 11:33:49 UTC (rev 128306)
@@ -8,6 +8,7 @@
 
 import compiler, sys
 import os
+import _ast
 
 checker = __import__('pyflakes.checker').checker
 
@@ -61,7 +62,7 @@
     else:
         # Okay, it's syntactically valid.  Now parse it into an ast and check
         # it.
-        tree = compiler.parse(codeString)
+        tree = compile(codeString, filename, "exec", _ast.PyCF_ONLY_AST)
         w = checker.Checker(tree, filename)
         w.messages.sort(lambda a, b: cmp(a.lineno, b.lineno))
         return w.messages



More information about the checkins mailing list