From: Pieter E. <pie...@gm...> - 2013-07-11 21:37:44
|
Dear all, When generating Python bindings using swig I can use python2, but not python3. I use > swig -c++ -py3 -python -Isrc/ oalib.i > python3 setup.py build_ext and get the following error. oalib_wrap.cxx: In function ‘const char* pytype_string(PyObject*)’: oalib_wrap.cxx:5615:32: error: ‘PyFile_Check’ was not declared in this scope oalib_wrap.cxx:5617:32: error: ‘PyInstance_Check’ was not declared in this scope oalib_wrap.cxx: In function ‘void SWIG_InitializeModule(void*)’: oalib_wrap.cxx:49038:21: warning: statement has no effect [-Wunused-value] error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 The problem is the PyFile_Check object generated by SWIG which is not present in Python3. How can I instruct swig to either generate proper code for python3, or generate an error when using c++ code that leads to PyFile objects? With kind regards, Pieter Eendebak |