◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
3 changes: 0 additions & 3 deletions Include/cpython/coreconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,6 @@ typedef struct {
wchar_t *base_prefix; /* sys.base_prefix */
wchar_t *exec_prefix; /* sys.exec_prefix */
wchar_t *base_exec_prefix; /* sys.base_exec_prefix */
#ifdef MS_WINDOWS
wchar_t *dll_path; /* Windows DLL path */
#endif

/* --- Parameter only used by Py_Main() ---------- */

Expand Down
4 changes: 4 additions & 0 deletions Include/internal/pycore_pathconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ PyAPI_FUNC(int) _Py_FindEnvConfigValue(
wchar_t *value,
size_t value_size);

#ifdef __cplusplus
}
#endif
Expand Down
18 changes: 8 additions & 10 deletions PC/getpathp.c
Original file line number Diff line number Diff line change
@@ -508,8 +508,8 @@ getpythonregpath(HKEY keyBase, int skipcore)
#endif /* Py_ENABLE_SHARED */


static _PyInitError
get_dll_path(PyCalculatePath *calculate, _PyPathConfig *config)
{
wchar_t dll_path[MAXPATHLEN+1];
memset(dll_path, 0, sizeof(dll_path));
Expand All @@ -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();
}


Expand Down Expand Up @@ -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;
}

err = get_program_full_path(core_config, calculate, config);
Expand Down
16 changes: 3 additions & 13 deletions Python/pathconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ _PyCoreConfig_SetPathConfig(const _PyCoreConfig *core_config)
goto no_memory;
}
#ifdef MS_WINDOWS
if (copy_wstr(&path_config.dll_path, core_config->dll_path) < 0) {
goto no_memory;
}
#endif
Expand Down Expand Up @@ -322,14 +323,6 @@ _PyCoreConfig_CalculatePathConfig(_PyCoreConfig *config)
}
}

#ifdef MS_WINDOWS
if (config->dll_path == NULL) {
if (copy_wstr(&config->dll_path, path_config.dll_path) < 0) {
goto no_memory;
}
}
#endif

if (path_config.isolated != -1) {
config->isolated = path_config.isolated;
}
Expand All @@ -356,9 +349,6 @@ _PyCoreConfig_InitPathConfig(_PyCoreConfig *config)
if (!config->use_module_search_paths
|| (config->executable == NULL)
|| (config->prefix == NULL)
#ifdef MS_WINDOWS
|| (config->dll_path == NULL)
#endif
|| (config->exec_prefix == NULL))
{
_PyInitError err = _PyCoreConfig_CalculatePathConfig(config);
Expand Down Expand Up @@ -435,7 +425,7 @@ Py_SetPath(const wchar_t *path)
new_config.exec_prefix = _PyMem_RawWcsdup(L"");
alloc_error |= (new_config.exec_prefix == NULL);
#ifdef MS_WINDOWS
new_config.dll_path = _PyMem_RawWcsdup(L"");
alloc_error |= (new_config.dll_path == NULL);
#endif
new_config.module_search_path = _PyMem_RawWcsdup(path);
Expand Down
Toggle all file notes Toggle all file annotations