wrap initObjToJSON in PY_VERSION_HEX check so it returns an int in python 3 and void in python 2