Fix bootstrap code on Python 3