[Python-checkins] r50795 - in python/trunk: Lib/test/test_winreg.py Misc/NEWS PC/_winreg.c

martin.v.loewis python-checkins at python.org
Mon Jul 24 12:26:34 CEST 2006


Author: martin.v.loewis
Date: Mon Jul 24 12:26:33 2006
New Revision: 50795

Modified:
   python/trunk/Lib/test/test_winreg.py
   python/trunk/Misc/NEWS
   python/trunk/PC/_winreg.c
Log:
Patch #1448199: Release GIL around ConnectRegistry.

Modified: python/trunk/Lib/test/test_winreg.py
==============================================================================
--- python/trunk/Lib/test/test_winreg.py	(original)
+++ python/trunk/Lib/test/test_winreg.py	Mon Jul 24 12:26:33 2006
@@ -151,3 +151,6 @@
 else:
     print "Remote registry calls can be tested using",
     print "'test_winreg.py --remote \\\\machine_name'"
+    # perform minimal ConnectRegistry test which just invokes it
+    h = ConnectRegistry(None, HKEY_LOCAL_MACHINE)
+    h.Close()

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Mon Jul 24 12:26:33 2006
@@ -61,6 +61,8 @@
 Extension Modules
 -----------------
 
+- Patch #1448199: Release interpreter lock in _winreg.ConnectRegistry.
+
 - Patch #1521817: Index range checking on ctypes arrays containing
   exactly one element enabled again.  This allows iterating over these
   arrays, without the need to check the array size before.

Modified: python/trunk/PC/_winreg.c
==============================================================================
--- python/trunk/PC/_winreg.c	(original)
+++ python/trunk/PC/_winreg.c	Mon Jul 24 12:26:33 2006
@@ -960,7 +960,9 @@
 		return NULL;
 	if (!PyHKEY_AsHKEY(obKey, &hKey, FALSE))
 		return NULL;
+	Py_BEGIN_ALLOW_THREADS
 	rc = RegConnectRegistry(szCompName, hKey, &retKey);
+	Py_END_ALLOW_THREADS
 	if (rc != ERROR_SUCCESS)
 		return PyErr_SetFromWindowsErrWithFunction(rc,
 							   "ConnectRegistry");


More information about the Python-checkins mailing list