diff --git a/Lib/random.py b/Lib/random.py index 0047c9137a0..e6f6e4b5d90 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -62,7 +62,8 @@ try: from os import urandom as _urandom from binascii import hexlify as _hexlify -except ImportError: + _urandom(1) # verify that urandom is implemented +except (ImportError, NotImplementedError): _urandom = None