Provide access to the import lock, fixing SF bug #580952. This is
mostly from SF patch #683257, but I had to change unlock_import() to
return an error value to avoid fatal error.
Should this be backported? The patch requested this, but it's a new
feature.
diff --git a/Misc/NEWS b/Misc/NEWS
index f1b3a8b..cfcb7ac 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,7 +10,7 @@
*Release date: XX-XXX-2003*
Core and builtins
-----------------
+-----------------
- Through a bytecode optimizer bug (and I bet you didn't even know
Python *had* a bytecode optimizer :-), "unsigned" hex/oct constants
@@ -75,6 +75,12 @@
Extension modules
-----------------
+- The imp module now has ways to acquire and release the "import
+ lock": imp.acquire_lock() and imp.release_lock(). Note: this is a
+ reentrant lock, so releasing the lock only truly releases it when
+ this is the last release_lock() call. You can check with
+ imp.lock_held(). (SF bug #580952 and patch #683257.)
+
- Fix some bugs in the parser module. SF bug #678518.
- Thanks to Scott David Daniels, a subtle bug in how the zlib