summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/util.py
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-09-22 01:05:43 (GMT)
committerGreg Ward <gward@python.net>2000-09-22 01:05:43 (GMT)
commit7ec053544cf4849a138e70329ffeec1d6ab93e62 (patch)
tree4c0edcc74000222b4b88f6ee012f3734439cf1bf /Lib/distutils/util.py
parentf89259786a166ab93417cdf442c96bc03183278b (diff)
downloadcpython-7ec053544cf4849a138e70329ffeec1d6ab93e62.zip
cpython-7ec053544cf4849a138e70329ffeec1d6ab93e62.tar.gz
cpython-7ec053544cf4849a138e70329ffeec1d6ab93e62.tar.bz2
Fix 'convert_path()' so it returns immediately under Unix -- prevents blowing
up when the pathname starts with '/', which is needed when converting installation directories in the "install" command.
Diffstat (limited to 'Lib/distutils/util.py')
-rw-r--r--Lib/distutils/util.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py
index b60e39c..3f06807 100644
--- a/Lib/distutils/util.py
+++ b/Lib/distutils/util.py
@@ -68,15 +68,15 @@ def convert_path (pathname):
absolute (starts with '/') or contains local directory separators
(unless the local separator is '/', of course)."""
+ if os.sep == '/':
+ return pathname
if pathname[0] == '/':
raise ValueError, "path '%s' cannot be absolute" % pathname
if pathname[-1] == '/':
raise ValueError, "path '%s' cannot end with '/'" % pathname
- if os.sep != '/':
- paths = string.split (pathname, '/')
- return apply (os.path.join, paths)
- else:
- return pathname
+
+ paths = string.split(pathname, '/')
+ return apply(os.path.join, paths)
# convert_path ()