◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
8 changes: 6 additions & 2 deletions Modules/_bz2module.c
Original file line number Diff line number Diff line change
Expand Up @@ -652,11 +652,15 @@ _bz2_BZ2Decompressor___init___impl(BZ2Decompressor *self)
int bzerror;

#ifdef WITH_THREAD
self->lock = PyThread_allocate_lock();
if (self->lock == NULL) {
PyErr_SetString(PyExc_MemoryError, "Unable to allocate lock");
return -1;
}
#endif

self->needs_input = 1;
Expand Down
8 changes: 6 additions & 2 deletions Modules/_lzmamodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1181,11 +1181,15 @@ _lzma_LZMADecompressor___init___impl(Decompressor *self, int format,
self->lzs.next_in = NULL;

#ifdef WITH_THREAD
self->lock = PyThread_allocate_lock();
if (self->lock == NULL) {
PyErr_SetString(PyExc_MemoryError, "Unable to allocate lock");
return -1;
}
#endif

self->check = LZMA_CHECK_UNKNOWN;
Expand Down
Toggle all file notes Toggle all file annotations