Support python 2.6 and restore exception messages