TypeError: unable to convert a Python 'NoneType' object to a C++ 'int' instance