Fix with statement on Python 2.5; removed unused import