update Python binding to work with Python 3