mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
gh-106320: Use _PyInterpreterState_GET() (#106336)
Replace PyInterpreterState_Get() with inlined _PyInterpreterState_GET().
This commit is contained in:
parent
9a51a41961
commit
bc7eb17084
11 changed files with 34 additions and 35 deletions
|
@ -11,7 +11,7 @@ Copyright (c) Corporation for National Research Initiatives.
|
|||
#include "Python.h"
|
||||
#include "pycore_call.h" // _PyObject_CallNoArgs()
|
||||
#include "pycore_interp.h" // PyInterpreterState.codec_search_path
|
||||
#include "pycore_pyerrors.h" // _PyErr_FormatNote()
|
||||
#include "pycore_pyerrors.h" // _PyErr_FormatNote()
|
||||
#include "pycore_pystate.h" // _PyInterpreterState_GET()
|
||||
#include "pycore_ucnhash.h" // _PyUnicode_Name_CAPI
|
||||
#include <ctype.h>
|
||||
|
@ -55,7 +55,7 @@ int PyCodec_Register(PyObject *search_function)
|
|||
int
|
||||
PyCodec_Unregister(PyObject *search_function)
|
||||
{
|
||||
PyInterpreterState *interp = PyInterpreterState_Get();
|
||||
PyInterpreterState *interp = _PyInterpreterState_GET();
|
||||
PyObject *codec_search_path = interp->codec_search_path;
|
||||
/* Do nothing if codec_search_path is not created yet or was cleared. */
|
||||
if (codec_search_path == NULL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue