Commit 4859ba0d authored by Max Bélanger's avatar Max Bélanger Committed by Benjamin Peterson

closes bpo-31903: Release the GIL when calling into SystemConfiguration (GH-4178)

parent ec014a10
In :mod:`_scproxy`, drop the GIL when calling into ``SystemConfiguration`` to avoid
deadlocks.
......@@ -62,7 +62,10 @@ get_proxy_settings(PyObject* Py_UNUSED(mod), PyObject *Py_UNUSED(ignored))
PyObject* v;
int r;
Py_BEGIN_ALLOW_THREADS
proxyDict = SCDynamicStoreCopyProxies(NULL);
Py_END_ALLOW_THREADS
if (!proxyDict) {
Py_RETURN_NONE;
}
......@@ -172,7 +175,10 @@ get_proxies(PyObject* Py_UNUSED(mod), PyObject *Py_UNUSED(ignored))
int r;
CFDictionaryRef proxyDict = NULL;
Py_BEGIN_ALLOW_THREADS
proxyDict = SCDynamicStoreCopyProxies(NULL);
Py_END_ALLOW_THREADS
if (proxyDict == NULL) {
return PyDict_New();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment