From: Andrew M. Kuchling Date: Mon, 6 May 2002 13:57:19 +0000 (+0000) Subject: Prevent convert_path from crashing if the path is an empty string. Bugfix candidate. X-Git-Tag: v2.3c1~5721 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0b5c11252da09a244cb39de47909ed07f4fa82cf;p=thirdparty%2FPython%2Fcpython.git Prevent convert_path from crashing if the path is an empty string. Bugfix candidate. --- diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py index a51ce6601d59..d079588a9156 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, '/')