diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-05-18 02:17:01 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-18 02:17:01 (GMT) |
commit | 410759fba80aded5247b693c60745aa16906f3bb (patch) | |
tree | fd520f89cfd501f12bdaccab77ddb965ba984f20 /PC | |
parent | bab0db6076900cd828588be8595b3cdfade7e7e9 (diff) | |
download | cpython-410759fba80aded5247b693c60745aa16906f3bb.zip cpython-410759fba80aded5247b693c60745aa16906f3bb.tar.gz cpython-410759fba80aded5247b693c60745aa16906f3bb.tar.bz2 |
bpo-36763: Remove _PyCoreConfig.dll_path (GH-13402)
Diffstat (limited to 'PC')
-rw-r--r-- | PC/getpathp.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/PC/getpathp.c b/PC/getpathp.c index 64aa1e0..62c42ec 100644 --- a/PC/getpathp.c +++ b/PC/getpathp.c @@ -508,8 +508,8 @@ done: #endif /* Py_ENABLE_SHARED */ -static _PyInitError -get_dll_path(PyCalculatePath *calculate, _PyPathConfig *config) +wchar_t* +_Py_GetDLLPath(void) { wchar_t dll_path[MAXPATHLEN+1]; memset(dll_path, 0, sizeof(dll_path)); @@ -525,11 +525,7 @@ get_dll_path(PyCalculatePath *calculate, _PyPathConfig *config) dll_path[0] = 0; #endif - config->dll_path = _PyMem_RawWcsdup(dll_path); - if (config->dll_path == NULL) { - return _Py_INIT_NO_MEMORY(); - } - return _Py_INIT_OK(); + return _PyMem_RawWcsdup(dll_path); } @@ -956,9 +952,11 @@ calculate_path_impl(const _PyCoreConfig *core_config, { _PyInitError err; - err = get_dll_path(calculate, config); - if (_Py_INIT_FAILED(err)) { - return err; + assert(config->dll_path == NULL); + + config->dll_path = _Py_GetDLLPath(); + if (config->dll_path == NULL) { + return _Py_INIT_NO_MEMORY(); } err = get_program_full_path(core_config, calculate, config); |