Fix exception under python2.5