summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-05-18 02:17:01 (GMT)
committerGitHub <noreply@github.com>2019-05-18 02:17:01 (GMT)
commit410759fba80aded5247b693c60745aa16906f3bb (patch)
treefd520f89cfd501f12bdaccab77ddb965ba984f20 /Python
parentbab0db6076900cd828588be8595b3cdfade7e7e9 (diff)
downloadcpython-410759fba80aded5247b693c60745aa16906f3bb.zip
cpython-410759fba80aded5247b693c60745aa16906f3bb.tar.gz
cpython-410759fba80aded5247b693c60745aa16906f3bb.tar.bz2
bpo-36763: Remove _PyCoreConfig.dll_path (GH-13402)
Diffstat (limited to 'Python')
-rw-r--r--Python/coreconfig.c12
-rw-r--r--Python/pathconfig.c16
2 files changed, 3 insertions, 25 deletions
diff --git a/Python/coreconfig.c b/Python/coreconfig.c
index 3678d12..470bda8 100644
--- a/Python/coreconfig.c
+++ b/Python/coreconfig.c
@@ -531,9 +531,6 @@ _PyCoreConfig_Clear(_PyCoreConfig *config)
CLEAR(config->prefix);
CLEAR(config->base_prefix);
CLEAR(config->exec_prefix);
-#ifdef MS_WINDOWS
- CLEAR(config->dll_path);
-#endif
CLEAR(config->base_exec_prefix);
CLEAR(config->filesystem_encoding);
@@ -761,9 +758,6 @@ _PyCoreConfig_Copy(_PyCoreConfig *config, const _PyCoreConfig *config2)
COPY_WSTR_ATTR(prefix);
COPY_WSTR_ATTR(base_prefix);
COPY_WSTR_ATTR(exec_prefix);
-#ifdef MS_WINDOWS
- COPY_WSTR_ATTR(dll_path);
-#endif
COPY_WSTR_ATTR(base_exec_prefix);
COPY_ATTR(site_import);
@@ -864,9 +858,6 @@ _PyCoreConfig_AsDict(const _PyCoreConfig *config)
SET_ITEM_WSTR(base_prefix);
SET_ITEM_WSTR(exec_prefix);
SET_ITEM_WSTR(base_exec_prefix);
-#ifdef MS_WINDOWS
- SET_ITEM_WSTR(dll_path);
-#endif
SET_ITEM_INT(site_import);
SET_ITEM_INT(bytes_warning);
SET_ITEM_INT(inspect);
@@ -2355,9 +2346,6 @@ _PyCoreConfig_Read(_PyCoreConfig *config)
assert(config->base_prefix != NULL);
assert(config->exec_prefix != NULL);
assert(config->base_exec_prefix != NULL);
-#ifdef MS_WINDOWS
- assert(config->dll_path != NULL);
-#endif
}
assert(config->filesystem_encoding != NULL);
assert(config->filesystem_errors != NULL);
diff --git a/Python/pathconfig.c b/Python/pathconfig.c
index c8c69eb..3d9d3b1 100644
--- a/Python/pathconfig.c
+++ b/Python/pathconfig.c
@@ -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) {
+ path_config.dll_path = _Py_GetDLLPath();
+ if (path_config.dll_path == NULL) {
goto no_memory;
}
#endif
@@ -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;
}
@@ -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);
@@ -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"");
+ new_config.dll_path = _Py_GetDLLPath();
alloc_error |= (new_config.dll_path == NULL);
#endif
new_config.module_search_path = _PyMem_RawWcsdup(path);