Fix python 2.4 syntax.
Merge pull request #1598 from nouiz/py24

Fix python 2.4 syntax.