From 373b097ef975b1323c275b0b4a07663c9be4cdf5 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 4 Oct 2019 18:33:00 +0200 Subject: [PATCH] bpo-38353: Simplify calculate_pybuilddir() Calling _Py_wfopen() is enough to check if filename is an existing file or not. There is no need to check first isfile(). --- Modules/getpath.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Modules/getpath.c b/Modules/getpath.c index 993276fdc27d0c..057a929019755e 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) {