I think I brought up before how this wasn't very pythonic.  I think we should use a context manager so that the `with` statement can be used instead (http://docs.python.org/2/library/contextlib.html).