From 229bbf8c4928ba0ce6d47fbb0b102c1f20eac8c0 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 30 Jun 2010 01:41:14 +0000 Subject: [PATCH] Explicit inspect.currentframe() cycle break. --- __init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.49.0