changeset 9807:f359d4f528aa

setup: fix f51d1822d6fd refactoring, propagate env to runcmd
author Christian Boos <cboos@bct-technology.com>
date Mon, 09 Nov 2009 17:33:16 +0100
parents dafbe321fc1a
children 0d65e191ac4c
files setup.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/setup.py	Mon Nov 09 17:28:40 2009 -0200
+++ b/setup.py	Mon Nov 09 17:33:16 2009 +0100
@@ -97,7 +97,7 @@
 except ImportError:
     pass
 
-def runcmd(cmd):
+def runcmd(cmd, env):
     p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
                          stderr=subprocess.PIPE, env=env)
     out, err = p.communicate()
@@ -127,7 +127,7 @@
         # error 0xc0150004. See: http://bugs.python.org/issue3440
         env['SystemRoot'] = os.environ['SystemRoot']
     cmd = [sys.executable, 'hg', 'id', '-i', '-t']
-    l = runcmd(cmd).split()
+    l = runcmd(cmd, env).split()
     while len(l) > 1 and l[-1][0].isalpha(): # remove non-numbered tags
         l.pop()
     if len(l) > 1: # tag found
@@ -137,7 +137,7 @@
     elif len(l) == 1: # no tag found
         cmd = [sys.executable, 'hg', 'parents', '--template',
                '{latesttag}+{latesttagdistance}-']
-        version = runcmd(cmd) + l[0]
+        version = runcmd(cmd, env) + l[0]
     if version.endswith('+'):
         version += time.strftime('%Y%m%d')
 elif os.path.exists('.hg_archival.txt'):