summaryrefslogtreecommitdiffstats
path: root/Modules/getpath.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2019-10-07 10:56:59 (GMT)
committerGitHub <noreply@github.com>2019-10-07 10:56:59 (GMT)
commitb96145a6b5d89599ebccd2111d93f5670ddae840 (patch)
treeebaaf6f613f21fef2f5e0ab548d4d2d837b2f386 /Modules/getpath.c
parentd97f1ce6dba6c4aa5614adc06ad2e0948709845c (diff)
downloadcpython-b96145a6b5d89599ebccd2111d93f5670ddae840.zip
cpython-b96145a6b5d89599ebccd2111d93f5670ddae840.tar.gz
cpython-b96145a6b5d89599ebccd2111d93f5670ddae840.tar.bz2
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().
Diffstat (limited to 'Modules/getpath.c')
-rw-r--r--Modules/getpath.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/Modules/getpath.c b/Modules/getpath.c
index 993276f..057a929 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) {