Tweak these to run under Python 3 unmodified