
Remove all currently unused imports Prevent future unused imports Change-Id: I6ac26d5c71b79952a7732db300355a00310c712e
23 lines
519 B
Python
23 lines
519 B
Python
"""
|
|
wrapper for pyflakes to ignore gettext based warning:
|
|
"undefined name '_'"
|
|
|
|
From https://bugs.launchpad.net/pyflakes/+bug/844592
|
|
"""
|
|
import __builtin__
|
|
import os
|
|
import sys
|
|
|
|
from pyflakes.scripts import pyflakes
|
|
|
|
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)
|
|
|
|
del names, os, __builtin__
|
|
|
|
sys.exit(pyflakes.main())
|