Skip to content

Commit 4bd73bd

Browse files
Move get_io_state() to main header
1 parent 9af73fe commit 4bd73bd

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Modules/_io/_iomodule.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#define PY_SSIZE_T_CLEAN
1111
#include "Python.h"
1212
#include "_iomodule.h"
13-
#include "pycore_moduleobject.h" // _PyModule_GetState()
1413
#include "pycore_pystate.h" // _PyInterpreterState_GET()
1514

1615
#ifdef HAVE_SYS_TYPES_H
@@ -559,14 +558,6 @@ PyNumber_AsOff_t(PyObject *item, PyObject *err)
559558
return result;
560559
}
561560

562-
static inline _PyIO_State*
563-
get_io_state(PyObject *module)
564-
{
565-
void *state = _PyModule_GetState(module);
566-
assert(state != NULL);
567-
return (_PyIO_State *)state;
568-
}
569-
570561
_PyIO_State *
571562
_PyIO_get_module_state(void)
572563
{

Modules/_io/_iomodule.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include "exports.h"
66

7+
#include "pycore_moduleobject.h" // _PyModule_GetState()
78
#include "structmember.h"
89

910
/* ABCs */
@@ -153,6 +154,14 @@ typedef struct {
153154
#define IO_MOD_STATE(mod) ((_PyIO_State *)PyModule_GetState(mod))
154155
#define IO_STATE() _PyIO_get_module_state()
155156

157+
static inline _PyIO_State *
158+
get_io_state(PyObject *module)
159+
{
160+
void *state = _PyModule_GetState(module);
161+
assert(state != NULL);
162+
return (_PyIO_State *)state;
163+
}
164+
156165
extern _PyIO_State *_PyIO_get_module_state(void);
157166

158167
#ifdef MS_WINDOWS

0 commit comments

Comments
 (0)