Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f80db6c

Browse filesBrowse files
gh-101469: Optimise get_io_state() by using _PyModule_GetState() (GH-101470)
Automerge-Triggered-By: GH:erlend-aasland
1 parent 20c11f2 commit f80db6c
Copy full SHA for f80db6c

File tree

Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed

‎Modules/_io/_iomodule.c

Copy file name to clipboardExpand all lines: Modules/_io/_iomodule.c
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define PY_SSIZE_T_CLEAN
1111
#include "Python.h"
1212
#include "_iomodule.h"
13+
#include "pycore_moduleobject.h" // _PyModule_GetState()
1314
#include "pycore_pystate.h" // _PyInterpreterState_GET()
1415

1516
#ifdef HAVE_SYS_TYPES_H
@@ -560,7 +561,7 @@ PyNumber_AsOff_t(PyObject *item, PyObject *err)
560561
static inline _PyIO_State*
561562
get_io_state(PyObject *module)
562563
{
563-
void *state = PyModule_GetState(module);
564+
void *state = _PyModule_GetState(module);
564565
assert(state != NULL);
565566
return (_PyIO_State *)state;
566567
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.