diff options
author | Monty Taylor <mordred@inaugust.com> | 2013-02-11 22:55:09 -0800 |
---|---|---|
committer | Monty Taylor <mordred@inaugust.com> | 2013-02-25 04:34:24 -0500 |
commit | f42a3db8d8eade9808a21650c314bbcc149bb560 (patch) | |
tree | 07dc0753d2f191f6afce7502c4ee112797f72174 | |
parent | c312fd6742c035677347a6987fb17b67e2c72087 (diff) | |
download | oslo-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
-rw-r--r-- | tools/flakes.py | 19 | ||||
-rw-r--r-- | tools/test-requires | 2 | ||||
-rw-r--r-- | tox.ini | 2 |
3 files changed, 16 insertions, 7 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 @@ -28,4 +28,4 @@ deps = -r{toxinidir}/tools/pip-requires -r{toxinidir}/tools/test-options [testenv:pyflakes] -commands = pyflakes openstack setup.py update.py +commands = python tools/flakes.py openstack setup.py update.py |