8000 ensure that `errno` is not set in ``pysleep[zero_posix]` · python/cpython@ff959e1 · GitHub
[go: up one dir, main page]

Skip to content

Commit ff959e1

Browse files
committed
ensure that errno is not set in `pysleep[zero_posix]
1 parent 2996937 commit ff959e1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Modules/timemodule.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2217,6 +2217,7 @@ pysleep(PyTime_t timeout)
22172217
{
22182218
assert(timeout >= 0);
22192219
#ifndef MS_WINDOWS
2220+
assert(errno == 0);
22202221
if (timeout == 0) {
22212222
return pysleep_zero_posix();
22222223
}
@@ -2407,6 +2408,7 @@ pysleep(PyTime_t timeout)
24072408
static int
24082409
pysleep_zero_posix(void)
24092410
{
2411+
assert(errno == 0);
24102412
PyTime_t deadline, monotonic;
24112413
if (PyTime_Monotonic(&monotonic) < 0) {
24122414
return -1;

0 commit comments

Comments
 (0)
0