Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 41c8b37

Browse files
author
Victor Stinner
committed
copy_absolute() raises a fatal error on _Py_wgetcwd() failure
1 parent 015f4d8 commit 41c8b37

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Modules/getpath.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ copy_absolute(wchar_t *path, wchar_t *p)
236236
if (p[0] == SEP)
237237
wcscpy(path, p);
238238
else {
239-
_Py_wgetcwd(path, MAXPATHLEN);
239+
if (!_Py_wgetcwd(path, MAXPATHLEN))
240+
Py_FatalError("unable to get the current directory");
240241
if (p[0] == '.' && p[1] == SEP)
241242
p += 2;
242243
joinpath(path, p);

0 commit comments

Comments
 (0)