Commit bdbdfd73 authored by Raymond Hettinger's avatar Raymond Hettinger

SF bug #1022010: Import random fails

* trap NotImplementedError raised by os.urandom calls when not available
  on a particular system.
parent 0506c640
......@@ -62,7 +62,8 @@ RECIP_BPF = 2**-BPF
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment