bug 1388313, prep for py3, don't override filter global function, r=emin draft
authorAxel Hecht <axel@pike.org>
Tue, 15 Aug 2017 13:54:19 +0200
changeset 470 d307f0e524a17bd234cd45041bb955bc585f92a7
parent 469 6ab1caf91b231b92a0739a9abad748398e98bf4c
child 471 26a6679b33e9f5c3a7c44360a2d6121a14049d2c
push id158
push useraxel@mozilla.com
push dateFri, 02 Mar 2018 16:12:21 +0000
reviewersemin
bugs1388313
bug 1388313, prep for py3, don't override filter global function, r=emin MozReview-Commit-ID: 8avWShVZeAx
compare_locales/paths.py
--- a/compare_locales/paths.py
+++ b/compare_locales/paths.py
@@ -120,26 +120,26 @@ class ProjectConfig(object):
             if 'reference' in d:
                 rv['reference'] = Matcher(d['reference'])
             if 'test' in d:
                 rv['test'] = d['test']
             if 'locales' in d:
                 rv['locales'] = d['locales'][:]
             self.paths.append(rv)
 
-    def set_filter_py(self, filter):
+    def set_filter_py(self, filter_function):
         '''Set legacy filter.py code.
         Assert that no rules are set.
         Also, normalize output already here.
         '''
         assert not self.rules
 
         def filter_(module, path, entity=None):
             try:
-                rv = filter(module, path, entity=entity)
+                rv = filter_function(module, path, entity=entity)
             except BaseException:  # we really want to handle EVERYTHING here
                 return 'error'
             rv = {
                 True: 'error',
                 False: 'ignore',
                 'report': 'warning'
             }.get(rv, rv)
             assert rv in ('error', 'ignore', 'warning', None)