changeset: 95717:7d7bf5c34d7e branch: 3.3 parent: 94832:21cd7f83e0aa user: Christian Heimes date: Sun Apr 19 21:08:42 2015 +0200 files: Misc/NEWS Python/import.c description: Issue #23998: PyImport_ReInitLock() now checks for lock allocation error diff -r 21cd7f83e0aa -r 7d7bf5c34d7e Misc/NEWS --- a/Misc/NEWS Mon Mar 02 13:23:25 2015 -0500 +++ b/Misc/NEWS Sun Apr 19 21:08:42 2015 +0200 @@ -32,6 +32,11 @@ - Issue #23365: Fixed possible integer overflow in itertools.combinations_with_replacement. +C API +----- + +- Issue #23998: PyImport_ReInitLock() now checks for lock allocation error + What's New in Python 3.3.6? =========================== diff -r 21cd7f83e0aa -r 7d7bf5c34d7e Python/import.c --- a/Python/import.c Mon Mar 02 13:23:25 2015 -0500 +++ b/Python/import.c Sun Apr 19 21:08:42 2015 +0200 @@ -199,8 +199,12 @@ void _PyImport_ReInitLock(void) { - if (import_lock != NULL) + if (import_lock != NULL) { import_lock = PyThread_allocate_lock(); + if (import_lock == NULL) { + Py_FatalError("PyImport_ReInitLock failed to create a new lock"); + } + } if (import_lock_level > 1) { /* Forked as a side effect of import */ long me = PyThread_get_thread_ident();