summaryrefslogtreecommitdiffstats
path: root/Modules/_io/_iomodule.h
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2013-12-21 14:51:54 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2013-12-21 14:51:54 (GMT)
commit712cb734bda0227861630b365a97dfec88798c3b (patch)
treef0e79f0b144395b5a02d32de09dca263e669ee53 /Modules/_io/_iomodule.h
parent5255b86fba38a5e22a0991772a3c1bbf3edd66cc (diff)
downloadcpython-712cb734bda0227861630b365a97dfec88798c3b.zip
cpython-712cb734bda0227861630b365a97dfec88798c3b.tar.gz
cpython-712cb734bda0227861630b365a97dfec88798c3b.tar.bz2
Issue #20037: Avoid crashes when doing text I/O late at interpreter shutdown.
Diffstat (limited to 'Modules/_io/_iomodule.h')
-rw-r--r--Modules/_io/_iomodule.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/_io/_iomodule.h b/Modules/_io/_iomodule.h
index b90a658..8927864 100644
--- a/Modules/_io/_iomodule.h
+++ b/Modules/_io/_iomodule.h
@@ -135,8 +135,9 @@ typedef struct {
} _PyIO_State;
#define IO_MOD_STATE(mod) ((_PyIO_State *)PyModule_GetState(mod))
-#define IO_STATE IO_MOD_STATE(PyState_FindModule(&_PyIO_Module))
+#define IO_STATE() _PyIO_get_module_state()
+extern _PyIO_State *_PyIO_get_module_state(void);
extern PyObject *_PyIO_get_locale_module(_PyIO_State *);
extern PyObject *_PyIO_str_close;