Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e0ac2be

Browse files
committed
Issue #23998: PyImport_ReInitLock() now checks for lock allocation error
2 parents d6e53da + 418fd74 commit e0ac2be

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

Misc/NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,11 @@ Build
201201
- Issue #23686: Update OS X 10.5 installer and Windows builds to use
202202
OpenSSL 1.0.2a.
203203

204+
C API
205+
-----
206+
207+
- Issue #23998: PyImport_ReInitLock() now checks for lock allocation error
208+
204209

205210
What's New in Python 3.4.3?
206211
===========================

Python/import.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,12 @@ _PyImport_ReleaseLock(void)
207207
void
208208
_PyImport_ReInitLock(void)
209209
{
210-
if (import_lock != NULL)
210+
if (import_lock != NULL) {
211211
import_lock = PyThread_allocate_lock();
212+
if (import_lock == NULL) {
213+
Py_FatalError("PyImport_ReInitLock failed to create a new lock");
214+
}
215+
}
212216
if (import_lock_level > 1) {
213217
/* Forked as a side effect of import */
214218
long me = PyThread_get_thread_ident();

0 commit comments

Comments
 (0)