Kaydet (Commit) bf2e2f9b authored tarafından Victor Stinner's avatar Victor Stinner

Issue #18408: Fix zlib.compressobj() to handle PyThread_allocate_lock() failure

(MemoryError).
üst 3f15cf09
......@@ -132,6 +132,10 @@ newcompobject(PyTypeObject *type)
}
#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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment