Kaydet (Commit) a0633036 authored tarafından Guido van Rossum's avatar Guido van Rossum

Patch suggested by Perry Stoll -- os.path.normpath(".//x") returned

"/x", should return "x".
üst 86ad567c
...@@ -354,6 +354,8 @@ def normpath(path): ...@@ -354,6 +354,8 @@ def normpath(path):
while i < len(comps): while i < len(comps):
if comps[i] == '.': if comps[i] == '.':
del comps[i] del comps[i]
while i < len(comps) and comps[i] == '':
del comps[i]
elif comps[i] == '..' and i > 0 and comps[i-1] not in ('', '..'): elif comps[i] == '..' and i > 0 and comps[i-1] not in ('', '..'):
del comps[i-1:i+1] del comps[i-1:i+1]
i = i-1 i = i-1
......
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