Skip to content

Commit

Permalink
gh-101469: Optimise get_io_state() by using _PyModule_GetState() (GH-…
Browse files Browse the repository at this point in the history
…101470)

Automerge-Triggered-By: GH:erlend-aasland
  • Loading branch information
erlend-aasland committed Jan 31, 2023
1 parent 20c11f2 commit f80db6c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Modules/_io/_iomodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit f80db6c

Please sign in to comment.