File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,7 @@ PyEventLoop PyEventLoop::_loopNotFound() {
141
141
PyEventLoop PyEventLoop::_getLoopOnThread (PyThreadState *tstate) {
142
142
// Modified from Python 3.9 `get_running_loop` https://github.com/python/cpython/blob/7cb3a44/Modules/_asynciomodule.c#L241-L278
143
143
144
+ PyObject *ts_dict;
144
145
#if PY_VERSION_HEX >= 0x030d0000 // Python version is greater than 3.13
145
146
// The private `_PyThreadState_GetDict(tstate)` API gets removed in Python 3.13.
146
147
// However, simply replacing it with `PyThreadState_GetDict()` does not work,
@@ -156,11 +157,11 @@ PyEventLoop PyEventLoop::_getLoopOnThread(PyThreadState *tstate) {
156
157
return _loopNotFound ();
157
158
}
158
159
}
159
- PyObject * ts_dict = tstate->dict ;
160
+ ts_dict = tstate->dict ;
160
161
#elif PY_VERSION_HEX >= 0x03090000 // Python version is greater than 3.9
161
- PyObject * ts_dict = _PyThreadState_GetDict (tstate); // borrowed reference
162
+ ts_dict = _PyThreadState_GetDict (tstate); // borrowed reference
162
163
#else // Python 3.8
163
- PyObject * ts_dict = tstate->dict ; // see https://github.com/python/cpython/blob/v3.8.17/Modules/_asynciomodule.c#L244-L245
164
+ ts_dict = tstate->dict ; // see https://github.com/python/cpython/blob/v3.8.17/Modules/_asynciomodule.c#L244-L245
164
165
#endif
165
166
if (ts_dict == NULL ) {
166
167
return _loopNotFound ();
You can’t perform that action at this time.
0 commit comments