You can use the database handle as a context manager using the `with` statement if you like: http://docs.python.org/2/library/sqlite3.html#using-the-connection-as-a-context-manager