changeset 8648:ca443bac7ed4

fixed 0xc0150004 error building Mercurial under Python 2.6 for Windows
author Garth Roxburgh-Kidd <garth@deadlybloodyserious.com>
date Thu, 28 May 2009 17:03:35 +0200
parents cb74433f9b41
children 2c097e22492c
files setup.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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,