]> granicus.if.org Git - python/commitdiff
os.urandom no longer masks unrelated exceptions like SystemExit or
authorGeorg Brandl <georg@python.org>
Tue, 1 Aug 2006 18:49:24 +0000 (18:49 +0000)
committerGeorg Brandl <georg@python.org>
Tue, 1 Aug 2006 18:49:24 +0000 (18:49 +0000)
KeyboardInterrupt.

Lib/os.py
Misc/NEWS

index 31002acb75b0106d7659f140df8f52e666c30b5d..2d1b29b57bf422299fe71b04d3d6ce453efe62ec 100644 (file)
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -723,7 +723,7 @@ if not _exists("urandom"):
         """
         try:
             _urandomfd = open("/dev/urandom", O_RDONLY)
-        except:
+        except (OSError, IOError):
             raise NotImplementedError("/dev/urandom (or equivalent) not found")
         bytes = ""
         while len(bytes) < n:
index 9eeeff8b4abc3c28861d0d3c20ae581e1cc7b9dd..b498cc31c39730340869cd992475320cef34dec4 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -61,6 +61,9 @@ Core and builtins
 Library
 -------
 
+- os.urandom no longer masks unrelated exceptions like SystemExit or
+  KeyboardInterrupt.
+
 - Bug #1525866: Don't copy directory stat times in 
   shutil.copytree on Windows