mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Fulfill Martin's request to use try/except rather than a "look before
you leap" approach. Makes the early call to os.urandom() unnecessary.
This commit is contained in:
parent
c4536a1dea
commit
c1c43cad63
2 changed files with 13 additions and 18 deletions
|
@ -495,7 +495,11 @@ def test_main(verbose=None):
|
|||
TestDistributions,
|
||||
TestModule]
|
||||
|
||||
if random._urandom is not None:
|
||||
try:
|
||||
random.HardwareRandom().random()
|
||||
except NotImplementedError:
|
||||
pass
|
||||
else:
|
||||
testclasses.append(HardwareRandom_TestBasicOps)
|
||||
|
||||
test_support.run_unittest(*testclasses)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue