gh-116012: Preserve GetLastError() across calls to TlsGetValue on Windows (GH-116014)

This commit is contained in:
Steve Dower
2024-02-28 13:58:25 +00:00
committed by GitHub
parent 647053fed1
commit 9578288a3e
3 changed files with 7 additions and 10 deletions

View File

@@ -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);
}