better python 3 support in printing