Commit 026102a0 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Use random.randint instead of os.urandom

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2313 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent bff23e30
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import os import os
import random
import unittest import unittest
import tempfile import tempfile
import MySQLdb import MySQLdb
...@@ -134,7 +135,7 @@ class NeoTestBase(unittest.TestCase): ...@@ -134,7 +135,7 @@ class NeoTestBase(unittest.TestCase):
def getPTID(self, i=None): def getPTID(self, i=None):
""" Return an integer PTID """ """ Return an integer PTID """
if i is None: if i is None:
return os.unpack('!Q', os.urandom(8))[0] return random.randint(1, 2**64)
return i return i
def getOID(self, i=None): def getOID(self, i=None):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment