windows: add win32com.shell to demandimport ignore list
authorKostia Balytskyi <ikostia@fb.com>
Fri, 14 Apr 2017 12:34:26 -0700
changeset 31990 3e03a4b9ec8c
parent 31989 85a22bc03d58
child 31991 55987fc8aba1
windows: add win32com.shell to demandimport ignore list Module 'appdirs' tries to import win32com.shell (and catch ImportError as an indication of failure) to check whether some further functionality should be implemented one or another way [1]. Of course, demandimport lets it down, so if we want appdirs to work we have to add it to demandimport's ignore list. The reason we want appdirs to work is becuase it is used by setuptools [2] to determine egg cache location. Only fairly recent versions of setuptools depend on this so people don't see this often. [1] https://github.com/ActiveState/appdirs/blob/master/appdirs.py#L560 [2] https://github.com/pypa/setuptools/blob/aae0a928119d2a178882c32bded02270e30d0273/pkg_resources/__init__.py#L1369
mercurial/demandimport.py
tests/test-check-code.t
--- a/mercurial/demandimport.py	Thu Apr 13 16:28:15 2017 +0200
+++ b/mercurial/demandimport.py	Fri Apr 14 12:34:26 2017 -0700
@@ -274,6 +274,7 @@
     'fcntl',
     'nt', # pathlib2 tests the existence of built-in 'nt' module
     'win32com.gen_py',
+    'win32com.shell', # 'appdirs' tries to import win32com.shell
     '_winreg', # 2.7 mimetypes needs immediate ImportError
     'pythoncom',
     # imported by tarfile, not available under Windows
--- a/tests/test-check-code.t	Thu Apr 13 16:28:15 2017 +0200
+++ b/tests/test-check-code.t	Fri Apr 14 12:34:26 2017 -0700
@@ -13,7 +13,7 @@
    >             r.revision(r.node(x))
    don't convert rev to node before passing to revision(nodeorrev)
   Skipping i18n/polib.py it has no-che?k-code (glob)
-  mercurial/demandimport.py:312:
+  mercurial/demandimport.py:313:
    >     if os.environ.get('HGDEMANDIMPORT') != 'disable':
    use encoding.environ instead (py3)
   mercurial/encoding.py:54: