python3 compatibility but shortening broken