diff options
author | Erlend E. Aasland <erlend.aasland@protonmail.com> | 2023-01-31 18:19:11 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-31 18:19:11 (GMT) |
commit | f80db6cef075186f888a85258ccf2164bf148921 (patch) | |
tree | 30173ab4ea3ab8e5200cb7e342501bc7f2b3cbd3 /Modules | |
parent | 20c11f2e600e1c0bf42de4d6f2fb3ce5ccc2587c (diff) | |
download | cpython-f80db6cef075186f888a85258ccf2164bf148921.zip cpython-f80db6cef075186f888a85258ccf2164bf148921.tar.gz cpython-f80db6cef075186f888a85258ccf2164bf148921.tar.bz2 |
gh-101469: Optimise get_io_state() by using _PyModule_GetState() (GH-101470)
Automerge-Triggered-By: GH:erlend-aasland
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_io/_iomodule.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c index af5950c..175fa97 100644 --- a/Modules/_io/_iomodule.c +++ b/Modules/_io/_iomodule.c @@ -10,6 +10,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" #include "_iomodule.h" +#include "pycore_moduleobject.h" // _PyModule_GetState() #include "pycore_pystate.h" // _PyInterpreterState_GET() #ifdef HAVE_SYS_TYPES_H @@ -560,7 +561,7 @@ PyNumber_AsOff_t(PyObject *item, PyObject *err) static inline _PyIO_State* get_io_state(PyObject *module) { - void *state = PyModule_GetState(module); + void *state = _PyModule_GetState(module); assert(state != NULL); return (_PyIO_State *)state; } |