summaryrefslogtreecommitdiffstats
path: root/Lib/ntpath.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-11-30 15:00:00 (GMT)
committerGuido van Rossum <guido@python.org>1999-11-30 15:00:00 (GMT)
commit6dfc792fea1cdf71dd601840c8832f917e89872d (patch)
tree85bdb4f05681ed563e82c9be7ebc007a36fa3486 /Lib/ntpath.py
parentd25c1b73d2c8ab561476de849026aef7bd25808e (diff)
downloadcpython-6dfc792fea1cdf71dd601840c8832f917e89872d.zip
cpython-6dfc792fea1cdf71dd601840c8832f917e89872d.tar.gz
cpython-6dfc792fea1cdf71dd601840c8832f917e89872d.tar.bz2
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.
Diffstat (limited to 'Lib/ntpath.py')
-rw-r--r--Lib/ntpath.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/ntpath.py b/Lib/ntpath.py
index 75cbe49..11ba060 100644
--- a/Lib/ntpath.py
+++ b/Lib/ntpath.py
@@ -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)