made new web2py_uuid working on python 2.5

This commit is contained in:
mdipierro
2012-09-29 18:35:09 -05:00
parent 0b4df40f60
commit 0c2d0178db
2 changed files with 3 additions and 3 deletions

View File

@@ -1 +1 @@
Version 2.0.9 (2012-09-29 17:56:36) dev
Version 2.0.9 (2012-09-29 18:35:01) dev

View File

@@ -157,8 +157,8 @@ def web2py_uuid(ctokens=UNPACKED_CTOKENS):
It works like uuid.uuid4 except that tries to use os.urandom() if possible
and it XORs the output with the tokens uniquely associated with this machine.
"""
rand_longs = struct.unpack('=QQ', bytes(bytearray(
random.randrange(256) for i in xrange(16))))
rand_longs = struct.unpack('=QQ', string.join(
(chr(random.randrange(256)) for i in xrange(16)),''))
if HAVE_URANDOM:
urand_longs = struct.unpack('=QQ', fast_urandom16())
byte_s = struct.pack('=QQ',