summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2002-05-06 13:57:19 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2002-05-06 13:57:19 (GMT)
commit0b5c11252da09a244cb39de47909ed07f4fa82cf (patch)
tree596bdca54d5a02b15e4b4f1e4d8ff40ed79ee5b5
parentefaffae8f6f6f0d1482e6931f851b1c7264c554d (diff)
downloadcpython-0b5c11252da09a244cb39de47909ed07f4fa82cf.zip
cpython-0b5c11252da09a244cb39de47909ed07f4fa82cf.tar.gz
cpython-0b5c11252da09a244cb39de47909ed07f4fa82cf.tar.bz2
Prevent convert_path from crashing if the path is an empty string. Bugfix candidate.
-rw-r--r--Lib/distutils/util.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py
index a51ce66..d079588 100644
--- a/Lib/distutils/util.py
+++ b/Lib/distutils/util.py
@@ -84,9 +84,9 @@ def convert_path (pathname):
"""
if os.sep == '/':
return pathname
- if pathname[0] == '/':
+ if pathname and pathname[0] == '/':
raise ValueError, "path '%s' cannot be absolute" % pathname
- if pathname[-1] == '/':
+ if pathname and pathname[-1] == '/':
raise ValueError, "path '%s' cannot end with '/'" % pathname
paths = string.split(pathname, '/')