python 2.4 compatible code in unittests

* This was breaking build on rhel5 platforms