commit | bdbdfd731dc2bf4b5490254c0df4b7c7e90ef751 | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Fri Sep 03 19:09:22 2004 +0000 |
committer | Raymond Hettinger <python@rcn.com> | Fri Sep 03 19:09:22 2004 +0000 |
tree | cca77698d3a35db77890d30b57619ead8f41cc8a | |
parent | 0506c64086e2535335a58b9368d2b940abbf8c11 [diff] [blame] |
SF bug #1022010: Import random fails * trap NotImplementedError raised by os.urandom calls when not available on a particular system.
diff --git a/Lib/random.py b/Lib/random.py index 0047c91..e6f6e4b 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