[Python 3]: Added workaround for unified integer and long types in Python 3.