diff options
Diffstat (limited to 'Python')
-rw-r--r-- | Python/coreconfig.c | 10 | ||||
-rw-r--r-- | Python/import.c | 4 |
2 files changed, 2 insertions, 12 deletions
diff --git a/Python/coreconfig.c b/Python/coreconfig.c index 7dabe5f964..829592c3c9 100644 --- a/Python/coreconfig.c +++ b/Python/coreconfig.c @@ -1,5 +1,4 @@ #include "Python.h" -#include "internal/import.h" #include "internal/pystate.h" @@ -52,7 +51,6 @@ int Py_IsolatedFlag = 0; /* for -I, isolate from user's env */ int Py_LegacyWindowsFSEncodingFlag = 0; /* Uses mbcs instead of utf-8 */ int Py_LegacyWindowsStdioFlag = 0; /* Uses FileIO instead of WindowsConsoleIO */ #endif -const char *_Py_CheckHashBasedPycsMode = "default"; void @@ -317,10 +315,6 @@ _PyCoreConfig_GetGlobalConfig(_PyCoreConfig *config) COPY_NOT_FLAG(write_bytecode, Py_DontWriteBytecodeFlag); COPY_NOT_FLAG(user_site_directory, Py_NoUserSiteDirectory); - if (config->_check_hash_pycs_mode == NULL) { - config->_check_hash_pycs_mode = _Py_CheckHashBasedPycsMode; - } - #undef COPY_FLAG #undef COPY_NOT_FLAG } @@ -359,10 +353,6 @@ _PyCoreConfig_SetGlobalConfig(const _PyCoreConfig *config) COPY_NOT_FLAG(write_bytecode, Py_DontWriteBytecodeFlag); COPY_NOT_FLAG(user_site_directory, Py_NoUserSiteDirectory); - if (config->_check_hash_pycs_mode != NULL) { - _Py_CheckHashBasedPycsMode = config->_check_hash_pycs_mode; - } - /* Random or non-zero hash seed */ Py_HashRandomizationFlag = (config->use_hash_seed == 0 || config->hash_seed != 0); diff --git a/Python/import.c b/Python/import.c index de132a347e..71d5ea192d 100644 --- a/Python/import.c +++ b/Python/import.c @@ -5,7 +5,6 @@ #include "Python-ast.h" #undef Yield /* undefine macro conflicting with winbase.h */ #include "internal/hash.h" -#include "internal/import.h" #include "internal/pystate.h" #include "errcode.h" #include "marshal.h" @@ -2290,7 +2289,8 @@ PyInit__imp(void) d = PyModule_GetDict(m); if (d == NULL) goto failure; - PyObject *pyc_mode = PyUnicode_FromString(_Py_CheckHashBasedPycsMode); + _PyCoreConfig *config = &PyThreadState_GET()->interp->core_config; + PyObject *pyc_mode = PyUnicode_FromString(config->_check_hash_pycs_mode); if (pyc_mode == NULL) { goto failure; } |