fix syntax error in python 2.4
Merge pull request #1182 from nouiz/py2.4

fix syntax error in python 2.4