Skip to content

Commit

Permalink
Revert "Convert manual db cursor close to with expression"
Browse files Browse the repository at this point in the history
This reverts commit d15565f.
  • Loading branch information
agxs committed Nov 23, 2021
1 parent d15565f commit 7ff0c73
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nbexchange/dbutil.py
Expand Up @@ -193,8 +193,9 @@ def register_foreign_keys(engine):

@event.listens_for(engine, "connect")
def connect(dbapi_con, con_record):
with dbapi_con.cursor() as cursor:
cursor.execute("PRAGMA foreign_keys=ON")
cursor = dbapi_con.cursor()
cursor.execute("PRAGMA foreign_keys=ON")
cursor.close()


@event.listens_for(Session, "persistent_to_deleted")
Expand Down

0 comments on commit 7ff0c73

Please sign in to comment.