summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-07-24 10:26:33 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2006-07-24 10:26:33 (GMT)
commitbda0dde1c46c7f86c09f1b54d0b14125e9ab7f52 (patch)
tree9aaa09e3507d1af552ea3180c7d91731751c4517
parent8cab8b03e5a44acce3fb2c5416f877c3edcf9beb (diff)
downloadcpython-bda0dde1c46c7f86c09f1b54d0b14125e9ab7f52.zip
cpython-bda0dde1c46c7f86c09f1b54d0b14125e9ab7f52.tar.gz
cpython-bda0dde1c46c7f86c09f1b54d0b14125e9ab7f52.tar.bz2
Patch #1448199: Release GIL around ConnectRegistry.
-rw-r--r--Lib/test/test_winreg.py3
-rw-r--r--Misc/NEWS2
-rw-r--r--PC/_winreg.c2
3 files changed, 7 insertions, 0 deletions
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");