blob: 08640a6a15c950f34523b8f0a3a4f8749ffb761a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
$NetBSD: patch-Lib_multiprocessing_process.py,v 1.2 2015/04/24 03:01:36 rodent Exp $
--- Lib/multiprocessing/process.py.orig 2014-12-10 15:59:39.000000000 +0000
+++ Lib/multiprocessing/process.py
@@ -306,7 +306,15 @@ class _MainProcess(Process):
self._popen = None
self._counter = itertools.count(1)
self._children = set()
- self._authkey = AuthenticationString(os.urandom(32))
+ # Get randomness from urandom or the 'random' module.
+ # from http://bugs.python.org/issue6645
+ # for SCO OpenServer 5.0.7/3.2 and AIX
+ try:
+ self._authkey = AuthenticationString(os.urandom(32))
+ except:
+ import random
+ bytes = [chr(random.randrange(256)) for i in range(32)]
+ self._authkey = AuthenticationString(bytes)
self._tempdir = None
_current_process = _MainProcess()
|