mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
gh-107913: Fix possible losses of OSError error codes (GH-107930)
Functions like PyErr_SetFromErrno() and SetFromWindowsErr() should be called immediately after using the C API which sets errno or the Windows error code.
This commit is contained in:
parent
e407cea193
commit
2b15536fa9
17 changed files with 129 additions and 75 deletions
|
|
@ -370,8 +370,9 @@ _overlapped_RegisterWaitWithQueue_impl(PyObject *module, HANDLE Object,
|
|||
&NewWaitObject, Object, PostToQueueCallback, pdata, Milliseconds,
|
||||
WT_EXECUTEINWAITTHREAD | WT_EXECUTEONLYONCE))
|
||||
{
|
||||
SetFromWindowsErr(0);
|
||||
PyMem_RawFree(pdata);
|
||||
return SetFromWindowsErr(0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return Py_BuildValue(F_HANDLE, NewWaitObject);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue