]> granicus.if.org Git - python/commitdiff
In abspath(), always use normpath(), even when win32api is available
authorGuido van Rossum <guido@python.org>
Tue, 30 Nov 1999 15:00:00 +0000 (15:00 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 30 Nov 1999 15:00:00 +0000 (15:00 +0000)
(and even when it fails).  This avoids the problem where a trailing
separator is not removed when win32api.GetFullPathName() is used.

Lib/ntpath.py

index 75cbe4980df09a7d0554685e43e99f58bd881a66..11ba0602e46f541396914514c3d1830fade05315 100644 (file)
@@ -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)