Closed litlighilit closed 1 week ago
when defined(windows): import std/os sleep(-1) # <- deadloop
BTW, on POSIX, it just returns immediately, as sleep calls nanosleep, which exits with errno set as EINVAL for negative values.
nanosleep
EINVAL
At least from 1.6.14 to 2.1.1 and devel
No response
Two direction:
In Python, time.sleep raises ValueError on negative value.
Maybe we can raises OSError as Nim's sleep is in std/os
std/os
a mistaking duplicate of 23722,
Description
BTW, on POSIX, it just returns immediately, as sleep calls
nanosleep
, which exits with errno set asEINVAL
for negative values.Nim Version
At least from 1.6.14 to 2.1.1 and devel
Current Output
No response
Expected Output
No response
Possible Solution
Two direction:
Additional Information
In Python, time.sleep raises ValueError on negative value.
Maybe we can raises OSError as Nim's sleep is in
std/os