made tests/test_cmd.py work in Python 2.5 (with statement)