fixed Python 2.5 compatibility

as revealed by Travis CI