python 2.6/3 except format