[Python-checkins] r56160 - python/branches/cpy_merge/Modules/_bytes_iomodule.c
alexandre.vassalotti
python-checkins at python.org
Tue Jul 3 17:41:23 CEST 2007
Author: alexandre.vassalotti
Date: Tue Jul 3 17:41:22 2007
New Revision: 56160
Modified:
python/branches/cpy_merge/Modules/_bytes_iomodule.c
Log:
Check if the object is closed in the readinto method.
Modified: python/branches/cpy_merge/Modules/_bytes_iomodule.c
==============================================================================
--- python/branches/cpy_merge/Modules/_bytes_iomodule.c (original)
+++ python/branches/cpy_merge/Modules/_bytes_iomodule.c Tue Jul 3 17:41:22 2007
@@ -283,6 +283,9 @@
void *raw_buffer;
Py_ssize_t len;
+ if (self->buf == NULL)
+ return err_closed();
+
if (PyObject_AsWriteBuffer(buffer, &raw_buffer, &len) == -1)
return NULL;
More information about the Python-checkins
mailing list