Skip to content
This repository was archived by the owner on Nov 26, 2021. It is now read-only.

Commit 7c163aa

Browse files
python3: avoid using sys.maxint
Since integers don't have limited size in Python 3, sys.maxint is gone. Replace its use by sys.maxsize, which is the closest approximation.
1 parent 9c6293e commit 7c163aa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/test_pelt_sim.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@
1919
from bart.sched.pelt import *
2020
from hypothesis import given
2121
from hypothesis.strategies import integers, tuples, none, one_of
22-
from sys import maxsize
2322
from utils_tests import TestBART
23+
import sys
24+
import math
2425

25-
# Required to use `int` not `long` henx ma=maxint
26+
# Required to use `int` not `long` on Python 2 ,hence ma=maxint
27+
maxint = getattr(sys, 'maxint', sys.maxsize)
2628
nonneg_ints = lambda mi=0, ma=maxint: integers(min_value=mi, max_value=ma)
2729

2830
# Generate a Simulator

0 commit comments

Comments
 (0)