fix swig wrapper for Python 3