mirror of
https://github.com/python/cpython.git
synced 2025-07-19 17:25:54 +00:00
Lyle Johnson: fixed broken logic in 'native_path()'.
This commit is contained in:
parent
e92e610a9e
commit
464023fb64
1 changed files with 7 additions and 7 deletions
|
@ -72,13 +72,13 @@ def native_path (pathname):
|
|||
raise ValueError, "path '%s' cannot be absolute" % pathname
|
||||
if pathname[-1] == '/':
|
||||
raise ValueError, "path '%s' cannot end with '/'" % pathname
|
||||
if os.sep != '/' and os.sep in pathname:
|
||||
raise ValueError, \
|
||||
"path '%s' cannot contain '%c' character" % \
|
||||
(pathname, os.sep)
|
||||
|
||||
paths = string.split (pathname, '/')
|
||||
return apply (os.path.join, paths)
|
||||
if os.sep != '/':
|
||||
if os.sep in pathname:
|
||||
raise ValueError, \
|
||||
"path '%s' cannot contain '%c' character" % (pathname, os.sep)
|
||||
else:
|
||||
paths = string.split (pathname, '/')
|
||||
return apply (os.path.join, paths)
|
||||
else:
|
||||
return pathname
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue