Skip to content

Commit

Permalink
Handle undocumented edge case in EvtNext
Browse files Browse the repository at this point in the history
  • Loading branch information
ofek authored and mhammond committed Jan 13, 2021
1 parent fc102c6 commit fa8554d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion win32/src/win32evtlog.i
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ static PyObject *PyEvtNext(PyObject *self, PyObject *args, PyObject *kwargs)
if (!bsuccess){
free(events);
DWORD err=GetLastError();
if (err == ERROR_NO_MORE_ITEMS)
if (err == ERROR_NO_MORE_ITEMS || (err == ERROR_INVALID_OPERATION && nbr_returned == 0))
return PyTuple_New(0);
return PyWin_SetAPIError("EvtNext", err);
}
Expand Down

0 comments on commit fa8554d

Please sign in to comment.