From: Victor Stinner Date: Mon, 7 Oct 2019 10:56:59 +0000 (+0200) Subject: bpo-38353: Simplify calculate_pybuilddir() (GH-16614) X-Git-Tag: v3.9.0a1~249 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b96145a6b5d89599ebccd2111d93f5670ddae840;p=thirdparty%2FPython%2Fcpython.git 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(). --- diff --git a/Modules/getpath.c b/Modules/getpath.c index 993276fdc27d..057a92901975 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -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) {