Python 2.4 compatibility for test cases