105 # care to not use any hgrc files and do no localization. |
105 # care to not use any hgrc files and do no localization. |
106 pypath = ['mercurial', os.path.join('mercurial', 'pure')] |
106 pypath = ['mercurial', os.path.join('mercurial', 'pure')] |
107 env = {'PYTHONPATH': os.pathsep.join(pypath), |
107 env = {'PYTHONPATH': os.pathsep.join(pypath), |
108 'HGRCPATH': '', |
108 'HGRCPATH': '', |
109 'LANGUAGE': 'C'} |
109 'LANGUAGE': 'C'} |
|
110 if 'SystemRoot' in os.environ: |
|
111 # Copy SystemRoot into the custom environment for Python 2.6 |
|
112 # under Windows. Otherwise, the subprocess will fail with |
|
113 # error 0xc0150004. See: http://bugs.python.org/issue3440 |
|
114 env['SystemRoot'] = os.environ['SystemRoot'] |
110 cmd = [sys.executable, 'hg', 'id', '-i', '-t'] |
115 cmd = [sys.executable, 'hg', 'id', '-i', '-t'] |
111 |
116 |
112 p = subprocess.Popen(cmd, stdout=subprocess.PIPE, |
117 p = subprocess.Popen(cmd, stdout=subprocess.PIPE, |
113 stderr=subprocess.PIPE, env=env) |
118 stderr=subprocess.PIPE, env=env) |
114 out, err = p.communicate() |
119 out, err = p.communicate() |