blob: 89bf0481485105373f3ee113249db5af94dce94a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
--- bzrlib/osutils.py.orig Fri Oct 28 11:30:13 2005
+++ bzrlib/osutils.py Fri Oct 28 11:30:38 2005
@@ -448,10 +448,10 @@
except (NotImplementedError, AttributeError):
# If python doesn't have os.urandom, or it doesn't work,
# then try to first pull random data from /dev/urandom
- if os.path.exists("/dev/urandom"):
+ try:
rand_bytes = file('/dev/urandom', 'rb').read
# Otherwise, use this hack as a last resort
- else:
+ except:
# not well seeded, but better than nothing
def rand_bytes(n):
import random
|