diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/flakes.py | 19 | ||||
-rw-r--r-- | tools/test-requires | 2 |
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 |