bug 1388313, prep for py3, don't override filter global function, r=emin
MozReview-Commit-ID: 8avWShVZeAx
--- 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)