summaryrefslogtreecommitdiff
path: root/tools/flakes.py
blob: 6869a4477e06d2291df0107d15bbd9b0b7a6b0ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""
 wrapper for pyflakes to ignore gettext based warning:
     "undefined name '_'"

 Synced in from openstack-common
"""

__all__ = ['main']

import sys
import six.moves.builtins as builtins
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__":
    main()