Skip to content

Commit

Permalink
Update asyncdb/drivers/pg.py
Browse files Browse the repository at this point in the history
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
  • Loading branch information
phenobarbital and sourcery-ai[bot] authored Oct 24, 2024
1 parent 3c70420 commit 0d657ad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions asyncdb/drivers/pg.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,8 +919,10 @@ async def transaction(self):

async def commit(self):
if self._transaction:
await self._transaction.commit()
self._transaction = None
try:
await self._transaction.commit()
finally:
self._transaction = None

async def rollback(self):
if self._transaction:
Expand Down

0 comments on commit 0d657ad

Please sign in to comment.