diff -r c48583859e04 -r 65cd7e705ff6 contrib/check-py3-compat.py --- a/contrib/check-py3-compat.py Fri Aug 12 11:06:14 2016 +0900 +++ b/contrib/check-py3-compat.py Sat Aug 13 17:21:58 2016 +0900 @@ -14,6 +14,16 @@ import sys import traceback +# Modules that have both Python and C implementations. +_dualmodules = ( + 'base85.py', + 'bdiff.py', + 'diffhelpers.py', + 'mpatch.py', + 'osutil.py', + 'parsers.py', +) + def check_compat_py2(f): """Check Python 3 compatibility for a file with Python 2""" with open(f, 'rb') as fh: @@ -55,7 +65,9 @@ # out module paths for things not in a package can be confusing. if f.startswith(('hgext/', 'mercurial/')) and not f.endswith('__init__.py'): assert f.endswith('.py') - name = f.replace('/', '.')[:-3].replace('.pure.', '.') + name = f.replace('/', '.')[:-3] + if f.endswith(_dualmodules): + name = name.replace('.pure.', '.') try: importlib.import_module(name) except Exception as e: