From bda0dde1c46c7f86c09f1b54d0b14125e9ab7f52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Mon, 24 Jul 2006 10:26:33 +0000 Subject: Patch #1448199: Release GIL around ConnectRegistry. --- Lib/test/test_winreg.py | 3 +++ Misc/NEWS | 2 ++ PC/_winreg.c | 2 ++ 3 files changed, 7 insertions(+) diff --git a/Lib/test/test_winreg.py b/Lib/test/test_winreg.py index a9bc962..5830fd6 100644 --- a/Lib/test/test_winreg.py +++ b/Lib/test/test_winreg.py @@ -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() diff --git a/Misc/NEWS b/Misc/NEWS index ba6d0f8..7a6e22d 100644 --- 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. diff --git a/PC/_winreg.c b/PC/_winreg.c index 007885c..b39411a 100644 --- a/PC/_winreg.c +++ b/PC/_winreg.c @@ -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"); -- cgit v0.12