python: Drop usage of long type.
authorRussell Bryant <russell@ovn.org>
Mon, 14 Dec 2015 21:32:00 +0000 (16:32 -0500)
committerRussell Bryant <russell@ovn.org>
Tue, 2 Feb 2016 21:40:36 +0000 (16:40 -0500)
commit8f808842a0c3f6b63d027c05db77ff945c29d67c
treec792a6a7f64f618febf11651497c957e62bdff63
parent490bafe8d805c166b5b54b52ceb1f0c414244160
python: Drop usage of long type.

Python 2 has both long and int types.  Python 3 only has int, which
behaves like long.

In the case of needing a set of integer types, we can use
six.integer_types which includes int and long for Python 2 and just int
for Python 3.

We can convert all cases of long(value) to int(value), because as of
Python 2.4, when the result of an operation would be too big for an int,
the type is automatically converted to a long.

There were several places in this patch doing type comparisons.  The
preferred way to do this is using the isinstance() or issubclass()
built-in functions, so I converted the similar checks nearby while I was
at it.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
python/ovs/db/data.py
python/ovs/db/idl.py
python/ovs/db/parser.py
python/ovs/db/types.py
python/ovs/json.py
python/ovstest/args.py
python/ovstest/tests.py