From patchwork Fri Feb 26 06:40:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [STABLE,v2] demandimport: add _imp to ignore list From: Gregory Szorc X-Patchwork-Id: 13401 Message-Id: <1d9f3f93a47481ffe155.1456468804@ubuntu-vm-main> To: mercurial-devel@mercurial-scm.org Date: Thu, 25 Feb 2016 22:40:04 -0800 # HG changeset patch # User Gregory Szorc # Date 1456468511 28800 # Thu Feb 25 22:35:11 2016 -0800 # Branch stable # Node ID 1d9f3f93a47481ffe155e8beb801ff56e7c22d46 # Parent 2d437a0f3355834a9485bbbeb30a52a052c98f19 demandimport: add _imp to ignore list Mozilla is seeing an issue with demand importing of _imp failing in pkg_resources/__init__.py:fixup_namespace_packages. It strangely only reproduces when using a modern version of setuptools/pip in certain scenarios. Adding _imp to the demand import ignore list seems to make the problem go away. diff --git a/mercurial/demandimport.py b/mercurial/demandimport.py --- a/mercurial/demandimport.py +++ b/mercurial/demandimport.py @@ -211,16 +211,18 @@ def _demandimport(name, globals=None, lo for x in fromlist: processfromitem(mod, x) return mod ignore = [ '__future__', '_hashlib', + # ImportError during pkg_resources/__init__.py:fixup_namespace_package + '_imp', '_xmlplus', 'fcntl', 'win32com.gen_py', '_winreg', # 2.7 mimetypes needs immediate ImportError 'pythoncom', # imported by tarfile, not available under Windows 'pwd', 'grp',