diff options
Diffstat (limited to 'Lib/os.py')
-rw-r--r-- | Lib/os.py | 19 |
1 files changed, 0 insertions, 19 deletions
@@ -738,22 +738,3 @@ try: _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): - bs += read(_urandomfd, n - len(bs)) - finally: - close(_urandomfd) - return bs |