changeset: 95719:7ae8fd62d743 parent: 95715:4aab4e0cd759 parent: 95718:e0bd083fc9c1 user: Christian Heimes date: Sun Apr 19 21:15:02 2015 +0200 files: Misc/NEWS Python/import.c description: Issue #23998: PyImport_ReInitLock() now checks for lock allocation error diff -r 4aab4e0cd759 -r 7ae8fd62d743 Misc/NEWS --- a/Misc/NEWS Sun Apr 19 21:13:00 2015 +0300 +++ b/Misc/NEWS Sun Apr 19 21:15:02 2015 +0200 @@ -213,6 +213,11 @@ if Argument Clinic processes the same symbol multiple times, and it's emitted at the end of all processing rather than immediately after the first use. +C API +----- + +- Issue #23998: PyImport_ReInitLock() now checks for lock allocation error + What's New in Python 3.5.0 alpha 3? =================================== diff -r 4aab4e0cd759 -r 7ae8fd62d743 Python/import.c --- a/Python/import.c Sun Apr 19 21:13:00 2015 +0300 +++ b/Python/import.c Sun Apr 19 21:15:02 2015 +0200 @@ -209,8 +209,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();