Skip to content

Commit

Permalink
Explicitly define and use the connection context manager.
Browse files Browse the repository at this point in the history
  • Loading branch information
Apostolos Bessas committed Apr 7, 2012
1 parent bd02281 commit 69b5bf8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions receipts/db.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ def _reset_filename(self):


def insert_receipt(receipt): def insert_receipt(receipt):
"""Insert a receipt to the database.""" """Insert a receipt to the database."""
with conn(): with conn() as con:
conn.execute(INSERT_RECEIPT, receipt._db_values()) con.execute(INSERT_RECEIPT, receipt._db_values())

0 comments on commit 69b5bf8

Please sign in to comment.