contrib/hgfixes/fix_bytesmod.py
changeset 20399 74daabdf5ab5
parent 19872 681f7b9213a4
child 20701 d20817ac628a
--- a/contrib/hgfixes/fix_bytesmod.py	Thu Feb 06 02:19:38 2014 +0100
+++ b/contrib/hgfixes/fix_bytesmod.py	Tue Feb 04 18:09:20 2014 -0500
@@ -33,9 +33,10 @@
               '''
 
     def transform(self, node, results):
-        if self.filename in blacklist:
-            return
-        elif self.filename == 'mercurial/util.py':
+        for bfn in blacklist:
+            if self.filename.endswith(bfn):
+                return
+        if not self.filename.endswith('mercurial/py3kcompat.py'):
             touch_import('.', 'py3kcompat', node=node)
 
         formatstr = results['formatstr'].clone()
@@ -60,4 +61,3 @@
 
         call = Call(Name('bytesformatter', prefix=' '), args)
         return call
-