fixed 0xc0150004 error building Mercurial under Python 2.6 for Windows
authorGarth Roxburgh-Kidd <garth@deadlybloodyserious.com>
Thu, 28 May 2009 17:03:35 +0200
changeset 8648 ca443bac7ed4
parent 8647 cb74433f9b41
child 8649 2c097e22492c
fixed 0xc0150004 error building Mercurial under Python 2.6 for Windows
setup.py
--- a/setup.py	Thu May 28 08:29:40 2009 +0200
+++ b/setup.py	Thu May 28 17:03:35 2009 +0200
@@ -107,6 +107,11 @@
     env = {'PYTHONPATH': os.pathsep.join(pypath),
            'HGRCPATH': '',
            'LANGUAGE': 'C'}
+    if 'SystemRoot' in os.environ:
+        # Copy SystemRoot into the custom environment for Python 2.6
+        # under Windows. Otherwise, the subprocess will fail with
+        # error 0xc0150004. See: http://bugs.python.org/issue3440
+        env['SystemRoot'] = os.environ['SystemRoot']
     cmd = [sys.executable, 'hg', 'id', '-i', '-t']
 
     p = subprocess.Popen(cmd, stdout=subprocess.PIPE,