Issue #12459: time.sleep() now raises a ValueError if the sleep length is
negative, instead of an infinite sleep on Windows or raising an IOError on
Linux for example, to have the same behaviour on all platforms.
diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py
index 9d7dbc8..94de098 100644
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -27,6 +27,8 @@
int(self.t))
def test_sleep(self):
+ self.assertRaises(ValueError, time.sleep, -2)
+ self.assertRaises(ValueError, time.sleep, -1)
time.sleep(1.2)
def test_strftime(self):