diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2002-05-06 13:57:19 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2002-05-06 13:57:19 (GMT) |
commit | 0b5c11252da09a244cb39de47909ed07f4fa82cf (patch) | |
tree | 596bdca54d5a02b15e4b4f1e4d8ff40ed79ee5b5 | |
parent | efaffae8f6f6f0d1482e6931f851b1c7264c554d (diff) | |
download | cpython-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.py | 4 |
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, '/') |