Use sys.maxsize instead of sys.maxint

The sys.maxint constant was removed in python 3 and now it's
better to use sys.maxsize.
https://docs.python.org/3/whatsnew/3.0.html#integers

Change-Id: I5af1537ae04a16454f20040e01ec64a6454171a2
Closes-Bug: #1628830
(cherry picked from commit 6a8e88de82)
This commit is contained in:
Tetiana Lashchova 2016-09-29 11:57:33 +03:00 committed by Valerii Kovalchuk
parent 4a8b29d685
commit a97cc33777
2 changed files with 4 additions and 4 deletions

View File

@ -444,11 +444,11 @@ class CSARPackage(package_base.PackageBase):
spec = constraint['length']
if 'min' in spec:
translated['minLength'] = max(
translated.get('minLength', -sys.maxint - 1),
translated.get('minLength', -sys.maxsize - 1),
int(spec['min']))
if 'max' in spec:
translated['maxLength'] = min(
translated.get('maxLength', sys.maxint),
translated.get('maxLength', sys.maxsize),
int(spec['max']))
elif 'range' in constraint:

View File

@ -439,11 +439,11 @@ class HotPackage(package_base.PackageBase):
spec = constraint['length']
if 'min' in spec:
translated['minLength'] = max(
translated.get('minLength', -sys.maxint - 1),
translated.get('minLength', -sys.maxsize - 1),
int(spec['min']))
if 'max' in spec:
translated['maxLength'] = min(
translated.get('maxLength', sys.maxint),
translated.get('maxLength', sys.maxsize),
int(spec['max']))
elif 'range' in constraint: