python: Drop use of sys.maxint.
authorRussell Bryant <russell@ovn.org>
Tue, 15 Dec 2015 21:37:11 +0000 (16:37 -0500)
committerRussell Bryant <russell@ovn.org>
Tue, 2 Feb 2016 21:41:30 +0000 (16:41 -0500)
commitd36bbd37f6da56f7999f4978d9c471a49b6a2b02
tree65a8f44f2057273df2dff3991d545f1c7deb796a
parent981e9560cef1cc9d9f4de2e01298434bc13aa7ea
python: Drop use of sys.maxint.

sys.maxint does not exist in Python 3, as an int does not have a max
value anymore (except as limited by implementation details and system
resources).

sys.maxsize works as a reasonable substitute as it's the same as
sys.maxint.  The Python 3.0 release notes have this to say:

  The sys.maxint constant was removed, since there is no longer a limit
  to the value of integers. However, sys.maxsize can be used as an
  integer larger than any practical list or string index. It conforms to
  the implementation’s “natural” integer size and is typically the same
  as sys.maxint in previous releases on the same platform (assuming the
  same build options).

sys.maxsize is documented as:

  An integer giving the maximum value a variable of type Py_ssize_t can
  take. It’s usually 2**31 - 1 on a 32-bit platform and 2**63 - 1 on a
  64-bit platform.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
python/ovs/db/schema.py
python/ovs/db/types.py
python/ovs/json.py
python/ovs/vlog.py