made new web2py_uuid working on python 2.5

This commit is contained in:
mdipierro committed 2012-09-29 18:35:09 -05:00
1 parent 60a043479c
commit 57ad1ec1cf
2 files changed
+3 -3

No files matched your search

+1 -1
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
+2 -2
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 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. and it XORs the output with the tokens uniquely associated with this machine.
""" """
rand_longs = struct.unpack('=QQ', bytes(bytearray( rand_longs = struct.unpack('=QQ', string.join(
random.randrange(256) for i in xrange(16)))) (chr(random.randrange(256)) for i in xrange(16)),''))
if HAVE_URANDOM: if HAVE_URANDOM:
urand_longs = struct.unpack('=QQ', fast_urandom16()) urand_longs = struct.unpack('=QQ', fast_urandom16())
byte_s = struct.pack('=QQ', byte_s = struct.pack('=QQ',