gh-116012: Preserve GetLastError() across calls to TlsGetValue on Windows (GH-116014)
This commit is contained in:
@@ -2528,16 +2528,7 @@ PyGILState_Check(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef MS_WINDOWS
|
||||
int err = GetLastError();
|
||||
#endif
|
||||
|
||||
PyThreadState *tcur = gilstate_tss_get(runtime);
|
||||
|
||||
#ifdef MS_WINDOWS
|
||||
SetLastError(err);
|
||||
#endif
|
||||
|
||||
return (tstate == tcur);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user