8000 gh-125997: ensure that `time.sleep(0)` is not delayed on non-Windows platforms by picnixz · Pull Request #128274 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-125997: ensure that time.sleep(0) is not delayed on non-Windows platforms #128274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 26 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add errors assertions
  • Loading branch information
picnixz committed Dec 27, 2024
commit f15436e4751ba47a4834940b4b76436d876b693b
2 changes: 2 additions & 0 deletions Modules/timemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2216,6 +2216,7 @@ static int
pysleep(PyTime_t timeout)
{
assert(timeout >= 0);
assert(!PyErr_Occurred());
#ifndef MS_WINDOWS
if (timeout == 0) {
return pysleep_zero_posix();
Expand Down Expand Up @@ -2407,6 +2408,7 @@ pysleep(PyTime_t timeout)
static int
pysleep_zero_posix(void)
{
assert(!PyErr_Occurred());
PyTime_t deadline, monotonic;
if (PyTime_Monotonic(&monotonic) < 0) {
return -1;
Expand Down
Loading
0