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
ensure that errno=0 when calling pysleep[zero_posix]
  • Loading branch information
picnixz committed Dec 27, 2024
commit 80de853bf1d0c50d46272ecd06339e5e010c1f51
2 changes: 2 additions & 0 deletions Modules/timemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2217,6 +2217,7 @@ pysleep(PyTime_t timeout)
{
assert(timeout >= 0);
#ifndef MS_WINDOWS
assert(errno == 0);
if (timeout == 0) {
return pysleep_zero_posix();
}
Expand Do 7471 wn Expand Up @@ -2407,6 +2408,7 @@ pysleep(PyTime_t timeout)
static int
pysleep_zero_posix(void)
{
assert(errno == 0);
PyTime_t deadline, monotonic;
if (PyTime_Monotonic(&monotonic) < 0) {
return -1;
Expand Down
Loading
0