]> granicus.if.org Git - python/commitdiff
Prevent convert_path from crashing if the path is an empty string. Bugfix candidate.
authorAndrew M. Kuchling <amk@amk.ca>
Mon, 6 May 2002 13:57:19 +0000 (13:57 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Mon, 6 May 2002 13:57:19 +0000 (13:57 +0000)
Lib/distutils/util.py

index a51ce6601d591aba6d8170d32e3dbe38a3318bd3..d079588a91562ad86aad04ad5621eb881e5cd1a1 100644 (file)
@@ -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, '/')