Adapt to Python 2.5