X-Git-Url: https://git.saurik.com/cyql.git/blobdiff_plain/91d72c6c38f38909f6e86d70a622c7625b4c9462..229bbf8c4928ba0ce6d47fbb0b102c1f20eac8c0:/__init__.py diff --git a/__init__.py b/__init__.py index 0f11db4..2bddbe4 100644 --- a/__init__.py +++ b/__init__.py @@ -29,7 +29,10 @@ class connection(object): with self.cursor() as cursor: # two frames, accounting for execute() and @contextmanager locals = inspect.currentframe(depth + 2).f_locals - cursor.execute(statement.format(**locals), locals) + try: + cursor.execute(statement.format(**locals), locals) + finally: + del locals yield cursor @contextmanager