running test.py with python-2.5

With these couple of modifications I have run testsuite with python-2.5.4.