fix bisect for python3