Skip to content

Commit

Permalink
Merge pull request #147 from gisce/add_context_manager_to_PatchedCursor
Browse files Browse the repository at this point in the history
Fix PatchNewCursor if created cursors use context __enter__ /__exit__
  • Loading branch information
ecarreras authored Nov 24, 2023
2 parents f1b894f + 8da7641 commit 21f6c0a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions destral/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ def close(self):
def __getattr__(self, item):
return getattr(self.cursor, item)

def __enter__(self):
return self

def __exit__(self, exc_type, exc_val, exc_tb):
return


class PatchedConnection(object):
"""Patched connection wapper to return the same cursor.
Expand Down

0 comments on commit 21f6c0a

Please sign in to comment.