simplify porting to Python 3