From: Jay Freeman (saurik) Date: Wed, 30 Jun 2010 01:41:14 +0000 (+0000) Subject: Explicit inspect.currentframe() cycle break. X-Git-Url: https://git.saurik.com/cyql.git/commitdiff_plain/229bbf8c4928ba0ce6d47fbb0b102c1f20eac8c0 Explicit inspect.currentframe() cycle break. --- 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