8000 bpo-38353: Simplify calculate_pybuilddir() (GH-16614) · python/cpython@b96145a · GitHub
[go: up one dir, main page]

Skip to content

Commit b96145a

Browse files
authored
bpo-38353: Simplify calculate_pybuilddir() (GH-16614)
Calling _Py_wfopen() is enough to check if filename is an existing file or not. There is no need to check first isfile().
1 parent d97f1ce commit b96145a

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

Modules/getpath.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -657,11 +657,6 @@ calculate_pybuilddir(const wchar_t *argv0_path,
657657
return _PyStatus_NO_MEMORY();
658658
}
659659

660-
if (!isfile(filename)) {
661-
PyMem_RawFree(filename);
662-
return _PyStatus_OK();
663-
}
664-
665660
FILE *fp = _Py_wfopen(filename, L"rb");
666661
PyMem_RawFree(filename);
667662
if (fp == NULL) {

0 commit comments

Comments
 (0)
0