[Python-checkins] python/dist/src/Lib random.py,1.65,1.66

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Fri Sep 3 21:09:26 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13588

Modified Files:
	random.py 
Log Message:
SF bug #1022010:  Import random fails

* trap NotImplementedError raised by os.urandom calls when not available
  on a particular system.



Index: random.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/random.py,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- random.py	31 Aug 2004 02:19:55 -0000	1.65
+++ random.py	3 Sep 2004 19:09:22 -0000	1.66
@@ -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
 
 



More information about the Python-checkins mailing list