| --- a/Lib/os.py Fri Jan 27 09:42:45 2012 +0100 |
| +++ b/Lib/os.py Mon Feb 13 15:34:04 2012 -0500 |
| @@ -742,22 +742,3 @@ |
| _make_statvfs_result) |
| except NameError: # statvfs_result may not exist |
| pass |
| - |
| -if not _exists("urandom"): |
| - def urandom(n): |
| - """urandom(n) -> str |
| - |
| - Return a string of n random bytes suitable for cryptographic use. |
| - |
| - """ |
| - try: |
| - _urandomfd = open("/dev/urandom", O_RDONLY) |
| - except (OSError, IOError): |
| - raise NotImplementedError("/dev/urandom (or equivalent) not found") |
| - try: |
| - bs = b"" |
| - while n - len(bs) >= 1: |
| - bs += read(_urandomfd, n - len(bs)) |
| - finally: |
| - close(_urandomfd) |
| - return bs |