diff options
| author | Antoine Pitrou <solipsis@pitrou.net> | 2013-12-21 15:51:54 +0100 |
|---|---|---|
| committer | Antoine Pitrou <solipsis@pitrou.net> | 2013-12-21 15:51:54 +0100 |
| commit | 712cb734bda0227861630b365a97dfec88798c3b (patch) | |
| tree | f0e79f0b144395b5a02d32de09dca263e669ee53 /Modules/_io/bufferedio.c | |
| parent | 5255b86fba38a5e22a0991772a3c1bbf3edd66cc (diff) | |
| download | cpython-git-712cb734bda0227861630b365a97dfec88798c3b.tar.gz | |
Issue #20037: Avoid crashes when doing text I/O late at interpreter shutdown.
Diffstat (limited to 'Modules/_io/bufferedio.c')
| -rw-r--r-- | Modules/_io/bufferedio.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c index a04b48dd3a..34c2bb97bd 100644 --- a/Modules/_io/bufferedio.c +++ b/Modules/_io/bufferedio.c @@ -91,7 +91,9 @@ bufferediobase_readinto(PyObject *self, PyObject *args) static PyObject * bufferediobase_unsupported(const char *message) { - PyErr_SetString(IO_STATE->unsupported_operation, message); + _PyIO_State *state = IO_STATE(); + if (state != NULL) + PyErr_SetString(state->unsupported_operation, message); return NULL; } |
