Remove with statement to keep Python 2.4+ compatibility