Commit 6dfc792f authored by Guido van Rossum's avatar Guido van Rossum

In abspath(), always use normpath(), even when win32api is available

(and even when it fails).  This avoids the problem where a trailing
separator is not removed when win32api.GetFullPathName() is used.
parent d25c1b73
......@@ -404,10 +404,10 @@ def abspath(path):
try:
import win32api
try:
return win32api.GetFullPathName(path)
path = win32api.GetFullPathName(path)
except win32api.error:
return path # Bad path - return unchanged.
pass # Bad path - return unchanged.
except ImportError:
if not isabs(path):
path = join(os.getcwd(), path)
return normpath(path)
return normpath(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