aseba-community / aseba

Aseba is a set of tools which allow beginners to program robots easily and efficiently. To contact us, please open an issue.
http://aseba.wikidot.com
GNU Lesser General Public License v3.0
48 stars 62 forks source link

Python3 compatibility #888

Open nim65s opened 5 years ago

nim65s commented 5 years ago

Hi,

I got this compilation error, on a Raspberry Pi with ArchLinux ARM (as Raspbian has a version of Qt5 that is too old):

/home/alarm/aseba/enki/python/enki.cpp: In static member function 'static void* Vector_from_python::convertible(PyObject*)':
/home/alarm/aseba/enki/python/enki.cpp:108:34: error: 'PyInt_Check' was not declared in this scope
    if (!(PyFloat_Check(item0) || PyInt_Check(item0)))
                                  ^~~~~~~~~~~
/home/alarm/aseba/enki/python/enki.cpp:108:34: note: suggested alternative: 'PySet_Check'
    if (!(PyFloat_Check(item0) || PyInt_Check(item0)))
                                  ^~~~~~~~~~~
                                  PySet_Check
/home/alarm/aseba/enki/python/enki.cpp:112:34: error: 'PyInt_Check' was not declared in this scope
    if (!(PyFloat_Check(item1) || PyInt_Check(item1)))
                                  ^~~~~~~~~~~
/home/alarm/aseba/enki/python/enki.cpp:112:34: note: suggested alternative: 'PySet_Check'
    if (!(PyFloat_Check(item1) || PyInt_Check(item1)))
                                  ^~~~~~~~~~~
                                  PySet_Check
/home/alarm/aseba/enki/python/enki.cpp:123:34: error: 'PyInt_Check' was not declared in this scope
    if (!(PyFloat_Check(item0) || PyInt_Check(item0)))
                                  ^~~~~~~~~~~
/home/alarm/aseba/enki/python/enki.cpp:123:34: note: suggested alternative: 'PySet_Check'
    if (!(PyFloat_Check(item0) || PyInt_Check(item0)))
                                  ^~~~~~~~~~~
                                  PySet_Check
/home/alarm/aseba/enki/python/enki.cpp:127:34: error: 'PyInt_Check' was not declared in this scope
    if (!(PyFloat_Check(item1) || PyInt_Check(item1)))
                                  ^~~~~~~~~~~
/home/alarm/aseba/enki/python/enki.cpp:127:34: note: suggested alternative: 'PySet_Check'
    if (!(PyFloat_Check(item1) || PyInt_Check(item1)))
                                  ^~~~~~~~~~~
                                  PySet_Check

So it seems that this package is not yet compatible with Python 3, right ?

Therefore, I suggest either to make it compatible, or to raise an issue in CMake if PYTHON_VERSION_MAJOR > 2.

Also, this could be documented, and adding -DPYTHON_EXECUTABLE=$(which python2) should be enough to workaround this.

nim65s commented 5 years ago

Ok, enki is a submodule, and the issue has already been reported: https://github.com/enki-community/enki/issues/8

Still, I think that we should document that.