closes bpo-31903: Release the GIL when calling into SystemConfiguration (GH-4178)
(cherry picked from commit 4859ba0d2ce4506fddc3f55f90f8dce031b3804f)
Co-authored-by: Max Bélanger <aeromax@gmail.com>
diff --git a/Modules/_scproxy.c b/Modules/_scproxy.c
index 0e3b028..c566067 100644
--- a/Modules/_scproxy.c
+++ b/Modules/_scproxy.c
@@ -62,7 +62,10 @@
PyObject* v;
int r;
+ Py_BEGIN_ALLOW_THREADS
proxyDict = SCDynamicStoreCopyProxies(NULL);
+ Py_END_ALLOW_THREADS
+
if (!proxyDict) {
Py_RETURN_NONE;
}
@@ -172,7 +175,10 @@
int r;
CFDictionaryRef proxyDict = NULL;
+ Py_BEGIN_ALLOW_THREADS
proxyDict = SCDynamicStoreCopyProxies(NULL);
+ Py_END_ALLOW_THREADS
+
if (proxyDict == NULL) {
return PyDict_New();
}