]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix for Bug #110673: os.abspatth() now always returns os.getcwd() on Windows, if...
authorMark Hammond <mhammond@skippinet.com.au>
Mon, 14 Aug 2000 06:20:32 +0000 (06:20 +0000)
committerMark Hammond <mhammond@skippinet.com.au>
Mon, 14 Aug 2000 06:20:32 +0000 (06:20 +0000)
Lib/ntpath.py

index 034694ddb00bd54da23e1a77e8b41ec32292c817..f8334e55183ca1ab7ad74e27a2ce183bb77812f3 100644 (file)
@@ -416,8 +416,11 @@ def abspath(path):
             return normpath(path)
         abspath = _abspath
         return _abspath(path)
-    try:
-        path = win32api.GetFullPathName(path)
-    except win32api.error:
-        pass # Bad path - return unchanged.
+    if path: # Empty path must return current working directory.
+        try:
+            path = win32api.GetFullPathName(path)
+        except win32api.error:
+            pass # Bad path - return unchanged.
+    else:
+        path = os.getcwd()
     return normpath(path)