[Python-checkins] cpython: Issue #18408: Fix zlib.compressobj() to handle PyThread_allocate_lock() failure
victor.stinner
python-checkins at python.org
Tue Jul 9 00:53:49 CEST 2013
http://hg.python.org/cpython/rev/2ef2edfd1a4c
changeset: 84518:2ef2edfd1a4c
user: Victor Stinner <victor.stinner at gmail.com>
date: Tue Jul 09 00:29:03 2013 +0200
summary:
Issue #18408: Fix zlib.compressobj() to handle PyThread_allocate_lock() failure
(MemoryError).
files:
Modules/zlibmodule.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c
--- a/Modules/zlibmodule.c
+++ b/Modules/zlibmodule.c
@@ -132,6 +132,10 @@
}
#ifdef WITH_THREAD
self->lock = PyThread_allocate_lock();
+ if (self->lock == NULL) {
+ PyErr_SetString(PyExc_MemoryError, "Unable to allocate lock");
+ return NULL;
+ }
#endif
return self;
}
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list