Patchwork [2,of,3,v3] demandimport: replace distutils.msvc9compiler ignore with reject

login
register
mail settings
Submitter timeless
Date Sept. 21, 2016, 7:09 p.m.
Message ID <adb54fd7d90f0ca60743.1474484973@gcc2-power8.osuosl.org>
Download mbox | patch
Permalink /patch/16740/
State Superseded
Headers show

Comments

timeless - Sept. 21, 2016, 7:09 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1474484334 0
#      Wed Sep 21 18:58:54 2016 +0000
# Node ID adb54fd7d90f0ca607432ed7ae884da55ec427de
# Parent  33884775ee4b22109085387b0317aa17db73c483
# Available At https://bitbucket.org/timeless/mercurial-crew
#              hg pull https://bitbucket.org/timeless/mercurial-crew -r adb54fd7d90f
demandimport: replace distutils.msvc9compiler ignore with reject

Patch

diff -r 33884775ee4b -r adb54fd7d90f mercurial/demandimport.py
--- a/mercurial/demandimport.py	Wed Sep 21 18:59:07 2016 +0000
+++ b/mercurial/demandimport.py	Wed Sep 21 18:58:54 2016 +0000
@@ -296,8 +296,6 @@ 
     'rfc822',
     'mimetools',
     'sqlalchemy.events', # has import-time side effects (issue5085)
-    # setuptools 8 expects this module to explode early when not on windows
-    'distutils.msvc9compiler',
     ]
 
 rejects = {}
@@ -310,6 +308,11 @@ 
     if not mod in rejects:
         rejects[mod] = {}
     rejects[mod][prop] = [cls, msg]
+
+# setuptools 8 expects this module to explode early when not on windows
+if os.name != 'nt':
+    reject('distutils', 'msvc9compiler', ImportError, 'No module named _winreg')
+
 def isenabled():
     return builtins.__import__ == _demandimport