Python 2.5-2.6 compatibility fix