Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
In :mod:`_scproxy`, drop the GIL when calling into ``SystemConfiguration`` to avoid
deadlocks.
6 changes: 6 additions & 0 deletions Modules/_scproxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ get_proxy_settings(PyObject* mod __attribute__((__unused__)))
PyObject* v;
int r;

Py_BEGIN_ALLOW_THREADS
proxyDict = SCDynamicStoreCopyProxies(NULL);
Py_END_ALLOW_THREADS

if (!proxyDict) {
Py_RETURN_NONE;
}
Expand Down Expand Up @@ -172,7 +175,10 @@ get_proxies(PyObject* mod __attribute__((__unused__)))
int r;
CFDictionaryRef proxyDict = NULL;

Py_BEGIN_ALLOW_THREADS
proxyDict = SCDynamicStoreCopyProxies(NULL);
Py_END_ALLOW_THREADS

if (proxyDict == NULL) {
return PyDict_New();
}
Expand Down