From f42a3db8d8eade9808a21650c314bbcc149bb560 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Mon, 11 Feb 2013 22:55:09 -0800 Subject: 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 --- tools/flakes.py | 19 ++++++++++++++----- tools/test-requires | 2 +- 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'tools') 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 -- cgit