python 2.x compatible formatting