summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2009-06-01 05:43:16 +0000
committerDavid Cournapeau <cournape@gmail.com>2009-06-01 05:43:16 +0000
commit44d92ec449e7397bdefa49eb901e4bb89eafaa70 (patch)
tree97e4482ea88124ee2e2d6a42a803b0a6c4e5a4a7 /setup.py
parent83b35de76104b67b8d4f1f1db04166ac7cf814f1 (diff)
downloadnumpy-44d92ec449e7397bdefa49eb901e4bb89eafaa70.tar.gz
BUG #1100: fix svn version detection for localized environments.
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index 0e9229ccd..53affe94d 100755
--- a/setup.py
+++ b/setup.py
@@ -56,10 +56,23 @@ VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
# Return the svn version as a string, raise a ValueError otherwise
def svn_version():
+ def _minimal_ext_cmd(cmd):
+ # construct minimal environment
+ env = {}
+ path = os.environ.get('PATH')
+ if path is not None:
+ env['PATH'] = path
+ # LANGUAGE is used on win32
+ env['LANGUAGE'] = 'C'
+ env['LANG'] = 'C'
+ env['LC_ALL'] = 'C'
+ out = subprocess.Popen(cmd, stdout = subprocess.PIPE, env=env).communicate()[0]
+ return out
+
try:
- out = subprocess.Popen(['svn', 'info'], stdout = subprocess.PIPE).communicate()[0]
+ out = _minimal_ext_cmd(['svn', 'info'])
except OSError:
- print " --- Could not run svn info --- "
+ print(" --- Could not run svn info --- ")
return ""
r = re.compile('Revision: ([0-9]+)')