Skip to content

Commit

Permalink
Release cursor in raw_query() call after exception
Browse files Browse the repository at this point in the history
  • Loading branch information
rudyryk committed Nov 30, 2016
1 parent c2236f4 commit 917daf7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion peewee_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ def select(query):
finally:
yield from cursor.release

yield from cursor.release

This comment has been minimized.

Copy link
@insolite

insolite Apr 20, 2017

Contributor

Probably it is not necessary because of awaiting cursor.release in line above (finally block)?

return result


Expand Down Expand Up @@ -689,8 +690,9 @@ def raw_query(query):
yield from result.fetchone()
except GeneratorExit:
pass
finally:
yield from cursor.release

yield from cursor.release
return result


Expand Down

0 comments on commit 917daf7

Please sign in to comment.