diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_io/winconsoleio.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/_io/winconsoleio.c b/Modules/_io/winconsoleio.c index 30d1c76..b85c11b 100644 --- a/Modules/_io/winconsoleio.c +++ b/Modules/_io/winconsoleio.c @@ -964,6 +964,9 @@ _io__WindowsConsoleIO_write_impl(winconsoleio *self, Py_buffer *b) if (!self->writable) return err_mode("writing"); + if (!b->len) { + return PyLong_FromLong(0); + } if (b->len > BUFMAX) len = BUFMAX; else |