Merge pull request #1562 from richboss/dev_urandom

don't write to /dev/urandom on Windows platforms
This commit is contained in:
mdipierro
2017-01-30 12:47:50 -06:00
committed by GitHub
+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')