mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
Prevent convert_path from crashing if the path is an empty string. Bugfix candidate.
This commit is contained in:
@@ -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, '/')
|
||||
|
||||
Reference in New Issue
Block a user