summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-03-25 20:22:55 (GMT)
committerGitHub <noreply@github.com>2020-03-25 20:22:55 (GMT)
commit0e427c6d159e86f17270770cd8dc37372e3c4004 (patch)
tree6d2090b90405358e5fca7c5a6ceb023909b4362e /Modules
parent302e5a8f79514fd84bafbc44b7c97ec636302322 (diff)
downloadcpython-0e427c6d159e86f17270770cd8dc37372e3c4004.zip
cpython-0e427c6d159e86f17270770cd8dc37372e3c4004.tar.gz
cpython-0e427c6d159e86f17270770cd8dc37372e3c4004.tar.bz2
bpo-39947: Add _PyThreadState_GetDict() function (GH-19160)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_asynciomodule.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c
index fa94a65..1092b08 100644
--- a/Modules/_asynciomodule.c
+++ b/Modules/_asynciomodule.c
@@ -236,12 +236,13 @@ get_running_loop(PyObject **loop)
rl = cached_running_holder; // borrowed
}
else {
- if (ts->dict == NULL) {
+ PyObject *ts_dict = _PyThreadState_GetDict(ts); // borrowed
+ if (ts_dict == NULL) {
goto not_found;
}
rl = _PyDict_GetItemIdWithError(
- ts->dict, &PyId___asyncio_running_event_loop__); // borrowed
+ ts_dict, &PyId___asyncio_running_event_loop__); // borrowed
if (rl == NULL) {
if (PyErr_Occurred()) {
goto error;