mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
SF bug #574235, convert_path fails with empty pathname
This commit is contained in:
parent
858e34f649
commit
b0df6a1afa
1 changed files with 4 additions and 2 deletions
|
@ -84,9 +84,11 @@ def convert_path (pathname):
|
|||
"""
|
||||
if os.sep == '/':
|
||||
return pathname
|
||||
if pathname and pathname[0] == '/':
|
||||
if not pathname:
|
||||
return pathname
|
||||
if pathname[0] == '/':
|
||||
raise ValueError, "path '%s' cannot be absolute" % pathname
|
||||
if pathname and pathname[-1] == '/':
|
||||
if pathname[-1] == '/':
|
||||
raise ValueError, "path '%s' cannot end with '/'" % pathname
|
||||
|
||||
paths = string.split(pathname, '/')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue