avoid patching if already done
authorsylvain.thenault@logilab.fr
Tue, 24 Feb 2009 20:59:07 +0100
changeset 937 491dbd818f9b
parent 935 ec229cc67334
child 938 a69188963ccb
avoid patching if already done
devtools/__init__.py
--- a/devtools/__init__.py	Tue Feb 24 11:55:51 2009 +0100
+++ b/devtools/__init__.py	Tue Feb 24 20:59:07 2009 +0100
@@ -260,6 +260,8 @@
        - http://www.sqlite.org/cvstrac/tktview?tn=1327,33
        (some dates are returned as strings rather thant date objects)
     """
+    if hasattr(querier.__class__, '_devtools_sqlite_patched'):
+        return # already monkey patched
     def wrap_execute(base_execute):
         def new_execute(*args, **kwargs):
             rset = base_execute(*args, **kwargs)
@@ -288,7 +290,7 @@
             return rset
         return new_execute
     querier.__class__.execute = wrap_execute(querier.__class__.execute)
-
+    querier.__class__._devtools_sqlite_patched = True
 
 def init_test_database(driver='sqlite', configdir='data', config=None,
                        vreg=None):