diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-07-05 20:00:25 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-07-05 20:00:25 (GMT) |
commit | 7f53a5027d9e290dc288ed2d931ea4c383c416af (patch) | |
tree | e5ff2744cfd2f6f6521eae76b246e4d5cc560f70 /Lib | |
parent | 5351a1f956d4d03bea00b650a0333b8eebd2b799 (diff) | |
download | cpython-7f53a5027d9e290dc288ed2d931ea4c383c416af.zip cpython-7f53a5027d9e290dc288ed2d931ea4c383c416af.tar.gz cpython-7f53a5027d9e290dc288ed2d931ea4c383c416af.tar.bz2 |
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.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_time.py | 2 |
1 files changed, 2 insertions, 0 deletions
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 @@ class TimeTestCase(unittest.TestCase): 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): |