[pypy-commit] pypy default: only need to check in_use if it isn't a new statement

bdkearns noreply at buildbot.pypy.org
Thu Apr 4 19:49:18 CEST 2013


Author: Brian Kearns <bdkearns at gmail.com>
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
 


More information about the pypy-commit mailing list