]> granicus.if.org Git - python/commitdiff
copy_absolute() raises a fatal error on _Py_wgetcwd() failure
authorVictor Stinner <victor.stinner@haypocalc.com>
Thu, 7 Oct 2010 22:42:51 +0000 (22:42 +0000)
committerVictor Stinner <victor.stinner@haypocalc.com>
Thu, 7 Oct 2010 22:42:51 +0000 (22:42 +0000)
Modules/getpath.c

index 139d753b558d80dcd0e3a1422b430c7c8bdb7d2d..ee784dd7f1c1f0064e6774f0a53f1dd446580d7b 100644 (file)
@@ -236,7 +236,8 @@ copy_absolute(wchar_t *path, wchar_t *p)
     if (p[0] == SEP)
         wcscpy(path, p);
     else {
-        _Py_wgetcwd(path, MAXPATHLEN);
+        if (!_Py_wgetcwd(path, MAXPATHLEN))
+            Py_FatalError("unable to get the current directory");
         if (p[0] == '.' && p[1] == SEP)
             p += 2;
         joinpath(path, p);