Skip to content

Commit

Permalink
Add error handling for time.sleep audit event
Browse files Browse the repository at this point in the history
  • Loading branch information
encukou committed Aug 23, 2023
1 parent d8e1891 commit aee8eb3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Modules/timemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,9 @@ Return the clk_id of a thread's CPU time clock.");
static PyObject *
time_sleep(PyObject *self, PyObject *timeout_obj)
{
PySys_Audit("time.sleep", "O", timeout_obj);
if (PySys_Audit("time.sleep", "O", timeout_obj) < 0) {
return NULL;
}

_PyTime_t timeout;
if (_PyTime_FromSecondsObject(&timeout, timeout_obj, _PyTime_ROUND_TIMEOUT))
Expand Down

0 comments on commit aee8eb3

Please sign in to comment.