don't write to /dev/urandom on Windows platforms

This commit is contained in:
Richard Boß committed 2017-01-22 21:05:22 +01:00
1 parent f14c384d83
commit b2548f5631
1 file changed
+2
+2
View File
@@ -17,6 +17,7 @@ import random
import inspect import inspect
import time import time
import os import os
import sys
import re import re
import logging import logging
import socket import socket
@@ -299,6 +300,7 @@ def initialize_urandom():
try: try:
os.urandom(1) os.urandom(1)
have_urandom = True have_urandom = True
if sys.platform != 'win32':
try: try:
# try to add process-specific entropy # try to add process-specific entropy
frandom = open('/dev/urandom', 'wb') frandom = open('/dev/urandom', 'wb')