more python 2.6/3 exception handling