Show More
@@ -12,10 +12,10 b' from lib2to3.pygram import python_symbol' | |||||
12 | # XXX: Implementing a blacklist in 2to3 turned out to be more troublesome than |
|
12 | # XXX: Implementing a blacklist in 2to3 turned out to be more troublesome than | |
13 | # blacklisting some modules inside the fixers. So, this is what I came with. |
|
13 | # blacklisting some modules inside the fixers. So, this is what I came with. | |
14 |
|
14 | |||
15 |
blacklist = |
|
15 | blacklist = ('mercurial/demandimport.py', | |
16 | 'mercurial/py3kcompat.py', # valid python 3 already |
|
16 | 'mercurial/py3kcompat.py', # valid python 3 already | |
17 | 'mercurial/i18n.py', |
|
17 | 'mercurial/i18n.py', | |
18 |
|
|
18 | ) | |
19 |
|
19 | |||
20 | def isdocstring(node): |
|
20 | def isdocstring(node): | |
21 | def isclassorfunction(ancestor): |
|
21 | def isclassorfunction(ancestor): | |
@@ -83,7 +83,8 b' class FixBytes(fixer_base.BaseFix):' | |||||
83 | PATTERN = 'STRING' |
|
83 | PATTERN = 'STRING' | |
84 |
|
84 | |||
85 | def transform(self, node, results): |
|
85 | def transform(self, node, results): | |
86 | if self.filename in blacklist: |
|
86 | # The filename may be prefixed with a build directory. | |
|
87 | if self.filename.endswith(blacklist): | |||
87 | return |
|
88 | return | |
88 | if node.type == token.STRING: |
|
89 | if node.type == token.STRING: | |
89 | if _re.match(node.value): |
|
90 | if _re.match(node.value): |
General Comments 0
You need to be logged in to leave comments.
Login now