summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2013-02-11 22:55:09 -0800
committerMonty Taylor <mordred@inaugust.com>2013-02-25 04:34:24 -0500
commitf42a3db8d8eade9808a21650c314bbcc149bb560 (patch)
tree07dc0753d2f191f6afce7502c4ee112797f72174 /tools
parentc312fd6742c035677347a6987fb17b67e2c72087 (diff)
downloadoslo-f42a3db8d8eade9808a21650c314bbcc149bb560.tar.gz
oslo-f42a3db8d8eade9808a21650c314bbcc149bb560.tar.xz
oslo-f42a3db8d8eade9808a21650c314bbcc149bb560.zip
Update flakes.py to match 0.6.1.
pyflakes 0.6.1 changes a module path - but we want to use it, because it finally groks attributes properly. Change-Id: Id35d1551c78212adb7ab470cefd9a53827167a71
Diffstat (limited to 'tools')
-rw-r--r--tools/flakes.py19
-rw-r--r--tools/test-requires2
2 files changed, 15 insertions, 6 deletions
diff --git a/tools/flakes.py b/tools/flakes.py
index 7f96116..191bd6e 100644
--- a/tools/flakes.py
+++ b/tools/flakes.py
@@ -4,12 +4,21 @@
Synced in from openstack-common
"""
+
+__all__ = ['main']
+
+import __builtin__ as builtins
import sys
-import pyflakes.checker
-from pyflakes.scripts import pyflakes
+import pyflakes.api
+from pyflakes import checker
+
+
+def main():
+ checker.Checker.builtIns = (set(dir(builtins)) |
+ set(['_']) |
+ set(checker._MAGIC_GLOBALS))
+ sys.exit(pyflakes.api.main())
if __name__ == "__main__":
- orig_builtins = set(pyflakes.checker._MAGIC_GLOBALS)
- pyflakes.checker._MAGIC_GLOBALS = orig_builtins | set(['_'])
- sys.exit(pyflakes.main())
+ main()
diff --git a/tools/test-requires b/tools/test-requires
index 179071d..aa73391 100644
--- a/tools/test-requires
+++ b/tools/test-requires
@@ -12,7 +12,7 @@ nosexcover
openstack.nose_plugin
nosehtmloutput
pep8==1.3.3
-pyflakes
+pyflakes>=0.6.1
pylint
pyzmq==2.2.0.1
setuptools-git>=0.4