Author: Brian Kearns <[email protected]>
Branch: 
Changeset: r63011:1ecbb83c374b
Date: 2013-04-04 13:47 -0400
http://bitbucket.org/pypy/pypy/changeset/1ecbb83c374b/

Log:    only need to check in_use if it isn't a new statement

diff --git a/lib_pypy/_sqlite3.py b/lib_pypy/_sqlite3.py
--- a/lib_pypy/_sqlite3.py
+++ b/lib_pypy/_sqlite3.py
@@ -385,10 +385,10 @@
             self.cache[sql] = stat
             if len(self.cache) > self.maxcount:
                 self.cache.popitem(0)
-
-        if stat._in_use:
-            stat = Statement(self.connection, sql)
-            self.cache[sql] = stat
+        else:
+            if stat._in_use:
+                stat = Statement(self.connection, sql)
+                self.cache[sql] = stat
         stat._row_factory = row_factory
         return stat
 
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to