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 31b61d1 commit 209aca9
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 209aca9

Please sign in to comment.