summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_os.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2008-09-02 05:36:11 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2008-09-02 05:36:11 (GMT)
commitd712203d17d406b3ebdb1276e5f1694a2a7db120 (patch)
treea373256f30cd5a98b54a1bc70d57931a47a87d2c /Lib/test/test_os.py
parent2bb25cc1e212109dcba04feed4027a2447ec12d1 (diff)
downloadcpython-d712203d17d406b3ebdb1276e5f1694a2a7db120.zip
cpython-d712203d17d406b3ebdb1276e5f1694a2a7db120.tar.gz
cpython-d712203d17d406b3ebdb1276e5f1694a2a7db120.tar.bz2
Issue #3708: os.urandom no longer goes into an infinite loop when passed a
non-integer floating point number.
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r--Lib/test/test_os.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index cec023d..a618af4 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -497,6 +497,10 @@ class URandomTests (unittest.TestCase):
self.assertEqual(len(os.urandom(10)), 10)
self.assertEqual(len(os.urandom(100)), 100)
self.assertEqual(len(os.urandom(1000)), 1000)
+ # see http://bugs.python.org/issue3708
+ self.assertEqual(len(os.urandom(0.9)), 0)
+ self.assertEqual(len(os.urandom(1.1)), 1)
+ self.assertEqual(len(os.urandom(2.0)), 2)
except NotImplementedError:
pass