diff options
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/codeobject.c | 6 | ||||
-rw-r--r-- | Objects/moduleobject.c | 4 | ||||
-rw-r--r-- | Objects/unicodeobject.c | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 7cb72ceab4..da04af43a4 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -6,7 +6,7 @@ #include "structmember.h" #include "pycore_code.h" #include "pycore_interp.h" // PyInterpreterState.co_extra_freefuncs -#include "pycore_pystate.h" // _PyInterpreterState_GET_UNSAFE() +#include "pycore_pystate.h" // _PyInterpreterState_GET() #include "pycore_tupleobject.h" #include "clinic/codeobject.c.h" @@ -555,7 +555,7 @@ code_dealloc(PyCodeObject *co) co->co_opcache_size = 0; if (co->co_extra != NULL) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); _PyCodeObjectExtra *co_extra = co->co_extra; for (Py_ssize_t i = 0; i < co_extra->ce_size; i++) { @@ -1074,7 +1074,7 @@ _PyCode_GetExtra(PyObject *code, Py_ssize_t index, void **extra) int _PyCode_SetExtra(PyObject *code, Py_ssize_t index, void *extra) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); if (!PyCode_Check(code) || index < 0 || index >= interp->co_extra_user_count) { diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c index acb920a4c0..1f419ad083 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -165,7 +165,7 @@ _add_methods_to_object(PyObject *module, PyObject *name, PyMethodDef *functions) PyObject * PyModule_Create2(struct PyModuleDef* module, int module_api_version) { - if (!_PyImport_IsInitialized(_PyInterpreterState_GET_UNSAFE())) { + if (!_PyImport_IsInitialized(_PyInterpreterState_GET())) { PyErr_SetString(PyExc_SystemError, "Python import machinery not initialized"); return NULL; @@ -684,7 +684,7 @@ module_dealloc(PyModuleObject *m) static PyObject * module_repr(PyModuleObject *m) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); return PyObject_CallMethod(interp->importlib, "_module_repr", "O", m); } diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 938df24e1d..28ec8f10dc 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -436,7 +436,7 @@ unicode_check_encoding_errors(const char *encoding, const char *errors) return 0; } - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); #ifndef Py_DEBUG /* In release mode, only check in development mode (-X dev) */ if (!_PyInterpreterState_GetConfig(interp)->dev_mode) { @@ -3615,7 +3615,7 @@ PyUnicode_EncodeLocale(PyObject *unicode, const char *errors) PyObject * PyUnicode_EncodeFSDefault(PyObject *unicode) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); if (interp->fs_codec.utf8) { return unicode_encode_utf8(unicode, interp->fs_codec.error_handler, @@ -3851,7 +3851,7 @@ PyUnicode_DecodeFSDefault(const char *s) { PyObject* PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); if (interp->fs_codec.utf8) { return unicode_decode_utf8(s, size, interp->fs_codec.error_handler, @@ -16009,7 +16009,7 @@ _PyUnicode_FiniEncodings(PyThreadState *tstate) int _PyUnicode_EnableLegacyWindowsFSEncoding(void) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); PyConfig *config = (PyConfig *)_PyInterpreterState_GetConfig(interp); /* Set the filesystem encoding to mbcs/replace (PEP 529) */ |