Commit 01f0b57e authored by Jérome Perrin's avatar Jérome Perrin

ERP5TypeTestSuite: don't use sys.maxint for python3 compatibility

parent c354008f
Pipeline #33862 failed with stage
in 0 seconds
......@@ -148,7 +148,7 @@ class SavedTestSuite(ERP5TypeTestSuite):
def __init__(self, *args, **kw):
# Use same portal id for all tests run by current instance
# but keep it (per-run) random.
self._portal_id = 'portal_%i' % (random.randint(0, sys.maxint), )
self._portal_id = 'portal_%i' % (random.randint(0, 2**64), )
self._setup_failed = False
super(SavedTestSuite, self).__init__(*args, **kw)
......
  • Or we can use sys.maxsize that exists in Py2 as well.

    Python 2.7.18 (default, Mar 31 2024, 21:29:18)
    [GCC 8.5.0] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    (InteractiveConsole)
    >>> import sys
    >>> sys.maxint
    9223372036854775807
    >>> sys.maxsize
    9223372036854775807
    Python 3.9.18 (main, Dec  8 2023, 11:53:14)
    [GCC 8.5.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sys
    >>> sys.maxsize
    9223372036854775807
    >>> 2**64
    18446744073709551616
  • nice, thanks I did not know. I replaced this one and another one from an old commit.

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