[Python-checkins] cpython (3.3): Issue #23998: PyImport_ReInitLock() now checks for lock allocation error
christian.heimes
python-checkins at python.org
Sun Apr 19 21:15:49 CEST 2015
https://hg.python.org/cpython/rev/7d7bf5c34d7e
changeset: 95717:7d7bf5c34d7e
branch: 3.3
parent: 94832:21cd7f83e0aa
user: Christian Heimes <christian at python.org>
date: Sun Apr 19 21:08:42 2015 +0200
summary:
Issue #23998: PyImport_ReInitLock() now checks for lock allocation error
files:
Misc/NEWS | 5 +++++
Python/import.c | 6 +++++-
2 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -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 --git a/Python/import.c b/Python/import.c
--- a/Python/import.c
+++ b/Python/import.c
@@ -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();
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list