aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/svn_utils.py
diff options
context:
space:
mode:
authorPhilip Thiem <ptthiem@gmail.com>2013-07-05 10:37:42 -0500
committerPhilip Thiem <ptthiem@gmail.com>2013-07-05 10:37:42 -0500
commit0c39ec94423bda77dc46dc6c82294cdfd7447f89 (patch)
treed3d0d96f5ea16d1035efbf597164a6ddd2a98e8d /setuptools/svn_utils.py
parent5b7992850b0cddec9bc405042359cf751d970d59 (diff)
downloadexternal_python_setuptools-0c39ec94423bda77dc46dc6c82294cdfd7447f89.tar.gz
external_python_setuptools-0c39ec94423bda77dc46dc6c82294cdfd7447f89.tar.bz2
external_python_setuptools-0c39ec94423bda77dc46dc6c82294cdfd7447f89.zip
fixed some issues with OSError
have to emulate zipfile extract on py2.5 and earlier for tests --HG-- extra : rebase_source : c6ad4eab19a2a454b8b8043d88d9582168f617aa
Diffstat (limited to 'setuptools/svn_utils.py')
-rw-r--r--setuptools/svn_utils.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/setuptools/svn_utils.py b/setuptools/svn_utils.py
index 10c5861d..932ee75c 100644
--- a/setuptools/svn_utils.py
+++ b/setuptools/svn_utils.py
@@ -34,10 +34,14 @@ _SVN_VER_RE = re.compile(r'(?:(\d+):)?(\d+)([a-z]*)\s*$', re.I)
# python-subprocess-popen-environment-path
def _run_command(args, stdout=_PIPE, stderr=_PIPE):
#regarding the shell argument, see: http://bugs.python.org/issue8557
- proc = _Popen(args, stdout=stdout, stderr=stderr,
- shell=(sys.platform == 'win32'))
+ try:
+ proc = _Popen(args, stdout=stdout, stderr=stderr,
+ shell=(sys.platform == 'win32'))
+
+ data = proc.communicate()[0]
+ except OSError:
+ return 1, ''
- data = proc.communicate()[0]
#TODO: this is probably NOT always utf-8
try:
data = unicode(data, encoding='utf-8')
@@ -60,11 +64,13 @@ def _get_entry_schedule(entry):
def parse_revision(path):
- code, data = _run_command(['svnversion', path])
+ code, data = _run_command(['svnversion', '-c', path])
if code:
log.warn("svnversion failed")
- return []
+ return 0
+ else:
+ log.warn('Version: %s' % data.strip())
parsed = _SVN_VER_RE.match(data)
if parsed: