import sys

# True if we are running on Python 3.
PY3 = sys.version_info[0] == 3

if PY3:
    string_types = str,
    integer_types = int,
else:
    string_types = basestring,
    integer_types = (int, long)

import sys

# True if we are running on Python 3.
PY2 = sys.version_info[0] == 2

if PY2:
    string_types = basestring,
    integer_types = (int, long)
else:
    string_types = str,
    integer_types = int,

make Py3 compatibility future-proof