Skip to content

Commit

Permalink
Merge branch 'master' of github.com:zopefoundation/ZEO
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver committed Aug 30, 2013
2 parents ad1aba0 + 47cbb8d commit c3a7238
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/ZEO/auth/auth_digest.py
Expand Up @@ -46,11 +46,9 @@
from ZEO.hash import sha1

def get_random_bytes(n=8):
if os.path.exists("/dev/urandom"):
f = open("/dev/urandom", 'rb')
b = f.read(n)
f.close()
else:
try:
b = os.urandom(n)
except NotImplementedError:
L = [chr(random.randint(0, 255)) for i in range(n)]
b = b"".join(L)
return b
Expand Down

0 comments on commit c3a7238

Please sign in to comment.