Fix python2.5 compatibility