summaryrefslogtreecommitdiffstats
path: root/Lib/os.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/os.py')
-rw-r--r--Lib/os.py19
1 files changed, 0 insertions, 19 deletions
diff --git a/Lib/os.py b/Lib/os.py
index c612e17..6d598f3 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -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