diff --git a/contrib/check-py3-compat.py b/contrib/check-py3-compat.py --- a/contrib/check-py3-compat.py +++ b/contrib/check-py3-compat.py @@ -55,7 +55,7 @@ def check_compat_py3(f): # 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] + name = f.replace('/', '.')[:-3].replace('.pure.', '.') with open(f, 'r') as fh: try: imp.load_module(name, fh, '', ('py', 'r', imp.PY_SOURCE)) diff --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t --- a/tests/test-check-py3-compat.t +++ b/tests/test-check-py3-compat.t @@ -136,9 +136,8 @@ mercurial/patch.py: error importing: getattr(): attribute name must be string (error at pycompat.py:*) (glob) mercurial/pathutil.py: error importing: getattr(): attribute name must be string (error at pycompat.py:*) (glob) mercurial/peer.py: error importing: getattr(): attribute name must be string (error at pycompat.py:*) (glob) - mercurial/pure/mpatch.py: error importing module: cannot import name 'policy' (line *) (glob) - mercurial/pure/osutil.py: error importing module: cannot import name 'policy' (line *) (glob) - mercurial/pure/parsers.py: error importing module: No module named 'mercurial.pure.node' (line *) (glob) + mercurial/pure/mpatch.py: error importing: getattr(): attribute name must be string (error at pycompat.py:*) (glob) + mercurial/pure/parsers.py: error importing: getattr(): attribute name must be string (error at pycompat.py:*) (glob) mercurial/pushkey.py: error importing: getattr(): attribute name must be string (error at pycompat.py:*) (glob) mercurial/pvec.py: error importing: getattr(): attribute name must be string (error at pycompat.py:*) (glob) mercurial/registrar.py: error importing: getattr(): attribute name must be string (error at util.py:*) (glob)