Commit d14a7b0d authored by Jack Jansen's avatar Jack Jansen

Remove single "." components from pathnames, and return os.curdir if

the resulting path is empty.
parent a2946a75
......@@ -82,6 +82,10 @@ def convert_path (pathname):
raise ValueError, "path '%s' cannot end with '/'" % pathname
paths = string.split(pathname, '/')
while '.' in paths:
paths.remove('.')
if not paths:
return os.curdir
return apply(os.path.join, paths)
# convert_path ()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment