Visitar URL original
gh-101469: Optimise get_io_state() by using _PyModule_GetState() by erlend-aasland · Pull Request #101470 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
gh-101469: Optimise get_io_state() by using _PyModule_GetState()
  • Loading branch information
erlend-aasland committed Jan 31, 2023
commit bd4f58a384428b99484b39bcc634d29b5834d4df
3 changes: 2 additions & 1 deletion Modules/_io/_iomodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "Python.h"
#include "_iomodule.h"
#include "pycore_pystate.h" // _PyInterpreterState_GET()
#include "pycore_moduleobject.h" // _PyModule_GetState()

#ifdef HAVE_SYS_TYPES_H
#include <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