Skip to content

Commit ad9cb8c

Browse files
committed
add support for statement using cursors
1 parent fc01c4b commit ad9cb8c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

DBUtils/SteadyDB.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,13 @@ def _setsizes(self, cursor=None):
548548
else:
549549
cursor.setoutputsize(size, column)
550550

551+
def __enter__(self):
552+
return self
553+
554+
def __exit__(self, *exc_info):
555+
del exc_info
556+
self.close()
557+
551558
def close(self):
552559
"""Close the tough cursor.
553560

0 commit comments

Comments
 (0)