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().
This commit is contained in:
Victor Stinner 2019-10-07 12:56:59 +02:00 committed by GitHub
parent d97f1ce6db
commit b96145a6b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 5 deletions

View File

@ -657,11 +657,6 @@ calculate_pybuilddir(const wchar_t *argv0_path,
return _PyStatus_NO_MEMORY();
}
if (!isfile(filename)) {
PyMem_RawFree(filename);
return _PyStatus_OK();
}
FILE *fp = _Py_wfopen(filename, L"rb");
PyMem_RawFree(filename);
if (fp == NULL) {