Update tools/flakes to work with pydoc
Change-Id: Ib141553017aa88d6edb65b5d51c06740699a2480
This commit is contained in:
parent
4d648c4b3d
commit
41b95b3bdf
@ -1,22 +1,22 @@
|
|||||||
import __builtin__
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from pyflakes.scripts.pyflakes import main
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
wrapper for pyflakes to ignore gettext based warning:
|
wrapper for pyflakes to ignore gettext based warning:
|
||||||
"undefined name '_'"
|
"undefined name '_'"
|
||||||
|
|
||||||
From https://bugs.launchpad.net/pyflakes/+bug/844592
|
From https://bugs.launchpad.net/pyflakes/+bug/844592
|
||||||
"""
|
"""
|
||||||
|
import __builtin__
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
names = os.environ.get('PYFLAKES_BUILTINS', '_')
|
from pyflakes.scripts.pyflakes import main
|
||||||
names = [x.strip() for x in names.split(',')]
|
|
||||||
for x in names:
|
|
||||||
if not hasattr(__builtin__, x):
|
|
||||||
setattr(__builtin__, x, True)
|
|
||||||
|
|
||||||
del names, os, __builtin__
|
if __name__ == "__main__":
|
||||||
|
names = os.environ.get('PYFLAKES_BUILTINS', '_')
|
||||||
|
names = [x.strip() for x in names.split(',')]
|
||||||
|
for x in names:
|
||||||
|
if not hasattr(__builtin__, x):
|
||||||
|
setattr(__builtin__, x, True)
|
||||||
|
|
||||||
sys.exit(main())
|
del names, os, __builtin__
|
||||||
|
|
||||||
|
sys.exit(main())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user