]> git.saurik.com Git - cyql.git/commitdiff
Explicit inspect.currentframe() cycle break.
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 30 Jun 2010 01:41:14 +0000 (01:41 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Wed, 30 Jun 2010 01:41:14 +0000 (01:41 +0000)
__init__.py

index 0f11db4e73652355bfcfe9684e669ac847598fea..2bddbe4a0afbf6dbb2fb3c6af948d938d670786d 100644 (file)
@@ -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