wrap initObjToJSON in PY_HEX_VERSION checks so it returns an int under python3 and void under python 2