fix a portability problem with the Python binding (found by Prasanth)