Porting to python 2.4.x