From ff4584caca04cb3da0dbd5b1e9bf67e40adf5312 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 13 Mar 2020 18:03:56 +0100 Subject: bpo-39947: Use _PyInterpreterState_GET_UNSAFE() (GH-18978) Replace _PyInterpreterState_Get() function call with _PyInterpreterState_GET_UNSAFE() macro which is more efficient but don't check if tstate or interp is NULL. _Py_GetConfigsAsDict() now uses _PyThreadState_GET(). --- Python/dynload_shlib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Python/dynload_shlib.c') diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c index c51f97abd2..3603871133 100644 --- a/Python/dynload_shlib.c +++ b/Python/dynload_shlib.c @@ -2,7 +2,7 @@ /* Support for dynamic loading of extension modules */ #include "Python.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyInterpreterState_GET_UNSAFE() #include "importdl.h" #include @@ -94,7 +94,7 @@ _PyImport_FindSharedFuncptr(const char *prefix, } } - dlopenflags = _PyInterpreterState_Get()->dlopenflags; + dlopenflags = _PyInterpreterState_GET_UNSAFE()->dlopenflags; handle = dlopen(pathname, dlopenflags); -- cgit v1.2.1