makes code Python 3 compatible
manages naked except