From: Georg Brandl Date: Tue, 1 Aug 2006 18:49:24 +0000 (+0000) Subject: os.urandom no longer masks unrelated exceptions like SystemExit or X-Git-Tag: v2.5b3~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=07fec3aa5a7c9fb6b1f8bae6bf6773892a702ea0;p=python os.urandom no longer masks unrelated exceptions like SystemExit or KeyboardInterrupt. --- diff --git a/Lib/os.py b/Lib/os.py index 31002acb75..2d1b29b57b 100644 --- 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: diff --git a/Misc/NEWS b/Misc/NEWS index 9eeeff8b4a..b498cc31c3 100644 --- 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