From 81a7be3fa22c983209cc0ffb3537b92b0370f83c Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 14 Apr 2020 15:14:01 +0200 Subject: bpo-40268: Rename _PyInterpreterState_GET_UNSAFE() (GH-19509) Rename _PyInterpreterState_GET_UNSAFE() to _PyInterpreterState_GET() for consistency with _PyThreadState_GET() and to have a shorter name (help to fit into 80 columns). Add also "assert(tstate != NULL);" to the function. --- Objects/codeobject.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Objects/codeobject.c') 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) { -- cgit v1.2.1