Python 2.5 compatibility: with statement