summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-02-25 18:40:44 +0000
committerGerrit Code Review <review@openstack.org>2013-02-25 18:40:44 +0000
commit722fc7aa3fc6c8a3e61f4e08094db3a06593fd91 (patch)
tree3760915eba9f27252006fc854a92d77b0eafe509 /tools
parent62033300759ac6e7e1539c752bb22b27996ff5ee (diff)
parentf42a3db8d8eade9808a21650c314bbcc149bb560 (diff)
downloadoslo-722fc7aa3fc6c8a3e61f4e08094db3a06593fd91.tar.gz
oslo-722fc7aa3fc6c8a3e61f4e08094db3a06593fd91.tar.xz
oslo-722fc7aa3fc6c8a3e61f4e08094db3a06593fd91.zip
Merge "Update flakes.py to match 0.6.1."
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