We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c0f73d1 commit bc66913Copy full SHA for bc66913
Python/pystate.c
@@ -2193,7 +2193,17 @@ PyGILState_Check(void)
2193
return 0;
2194
}
2195
2196
- return (tstate == gilstate_tss_get(runtime));
+#ifdef MS_WINDOWS
2197
+ int err = GetLastError();
2198
+#endif
2199
+
2200
+ PyThreadState *tcur = gilstate_tss_get(runtime);
2201
2202
2203
+ SetLastError(err);
2204
2205
2206
+ return (tstate == tcur);
2207
2208
2209
PyGILState_STATE
0 commit comments