summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRussell Bryant <rbryant@redhat.com>2013-03-22 14:10:07 -0400
committerRussell Bryant <rbryant@redhat.com>2013-03-22 14:10:07 -0400
commitf665d798234c19cccc148a178e94c3717ba8bd6e (patch)
treece4dc2002d0080421333db225049ff51b7a3e725 /tools
parent81204d4020712cf5b5b368b75d934d637b2c001b (diff)
downloadnova-f665d798234c19cccc148a178e94c3717ba8bd6e.tar.gz
nova-f665d798234c19cccc148a178e94c3717ba8bd6e.tar.xz
nova-f665d798234c19cccc148a178e94c3717ba8bd6e.zip
Sync everything from oslo-incubator.
Change-Id: If602b424086abb3edbd4703bc0e3befedbf37925
Diffstat (limited to 'tools')
-rw-r--r--tools/flakes.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/tools/flakes.py b/tools/flakes.py
index 7f96116ca..191bd6eab 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()