Lyle Johnson: fixed broken logic in 'native_path()'.

This commit is contained in:
Greg Ward 2000-04-25 01:33:11 +00:00
parent e92e610a9e
commit 464023fb64

View file

@ -72,13 +72,13 @@ def native_path (pathname):
raise ValueError, "path '%s' cannot be absolute" % pathname raise ValueError, "path '%s' cannot be absolute" % pathname
if pathname[-1] == '/': if pathname[-1] == '/':
raise ValueError, "path '%s' cannot end with '/'" % pathname raise ValueError, "path '%s' cannot end with '/'" % pathname
if os.sep != '/' and os.sep in pathname: if os.sep != '/':
raise ValueError, \ if os.sep in pathname:
"path '%s' cannot contain '%c' character" % \ raise ValueError, \
(pathname, os.sep) "path '%s' cannot contain '%c' character" % (pathname, os.sep)
else:
paths = string.split (pathname, '/') paths = string.split (pathname, '/')
return apply (os.path.join, paths) return apply (os.path.join, paths)
else: else:
return pathname return pathname