copy_absolute() keeps the relative path on _Py_wgetcwd() failure
.. instead of raising a fatal error. Even if the current directory was deleted, use relative paths may still work (eg. run Python with "../python").
This commit is contained in:
parent
6672d0c5bb
commit
4f3abb0f09
|
@ -236,8 +236,11 @@ copy_absolute(wchar_t *path, wchar_t *p)
|
||||||
if (p[0] == SEP)
|
if (p[0] == SEP)
|
||||||
wcscpy(path, p);
|
wcscpy(path, p);
|
||||||
else {
|
else {
|
||||||
if (!_Py_wgetcwd(path, MAXPATHLEN))
|
if (!_Py_wgetcwd(path, MAXPATHLEN)) {
|
||||||
Py_FatalError("unable to get the current directory");
|
/* unable to get the current directory */
|
||||||
|
wcscpy(path, p);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (p[0] == '.' && p[1] == SEP)
|
if (p[0] == '.' && p[1] == SEP)
|
||||||
p += 2;
|
p += 2;
|
||||||
joinpath(path, p);
|
joinpath(path, p);
|
||||||
|
|
Loading…
Reference in New Issue