]> granicus.if.org Git - python/commitdiff
Patch #1448199: Release GIL around ConnectRegistry.
authorMartin v. Löwis <martin@v.loewis.de>
Mon, 24 Jul 2006 10:26:33 +0000 (10:26 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Mon, 24 Jul 2006 10:26:33 +0000 (10:26 +0000)
Lib/test/test_winreg.py
Misc/NEWS
PC/_winreg.c

index a9bc9621557a2e68a8e468138f87965c86fe8da1..5830fd64f5edf07eb3c64a2d2b96e98b74458868 100644 (file)
@@ -151,3 +151,6 @@ if remote_name is not None:
 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()
index ba6d0f8c68601295b52c9d26be29067caf0108e0..7a6e22d563d95b7bddd83901ce850cad891aba58 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -61,6 +61,8 @@ Library
 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.
index 007885c679de1f5324742ab78f9003091eb562e9..b39411a8ca910aa430ee6046ac7c803bdd46bf7c 100644 (file)
@@ -960,7 +960,9 @@ PyConnectRegistry(PyObject *self, PyObject *args)
                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");