bpo-31650: Remove _Py_CheckHashBasedPycsMode global config var (GH-8608)

bpo-31650, bpo-34170: Replace _Py_CheckHashBasedPycsMode with
_PyCoreConfig._check_hash_pycs_mode. Modify PyInit__imp() and
zipimport to get the parameter from the current interpreter core
configuration.

Remove Include/internal/import.h file.
This commit is contained in:
Victor Stinner 2018-08-01 18:18:07 +02:00 committed by GitHub
parent 6c785c0ebd
commit 80b762f010
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 24 deletions

View file

@ -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;
}