[refactoring] class variable is useless
authorLaurent Peuch <cortex@worlddomination.be>
Thu, 05 Dec 2019 18:40:38 +0100
changeset 12808 6cbb1e2a6e49
parent 12807 fb0936668535
child 12809 9b809497978f
[refactoring] class variable is useless
cubicweb/server/sqlutils.py
--- a/cubicweb/server/sqlutils.py	Thu Dec 05 18:39:09 2019 +0100
+++ b/cubicweb/server/sqlutils.py	Thu Dec 05 18:40:38 2019 +0100
@@ -274,8 +274,6 @@
     """Mixin for SQL data sources, getting a connection from a configuration
     dictionary and handling connection locking
     """
-    cnx_wrap = ConnectionWrapper
-
     def __init__(self, source_config, repairing=False):
         try:
             self.dbdriver = source_config['db-driver'].lower()
@@ -303,9 +301,13 @@
         self._binary = self.dbhelper.binary_value
         self._process_value = dbapi_module.process_value
         self._dbencoding = dbencoding
+
         if self.dbdriver == 'sqlite':
             self.cnx_wrap = SqliteConnectionWrapper
             self.dbhelper.dbname = abspath(self.dbhelper.dbname)
+        else:
+            self.cnx_wrap = ConnectionWrapper
+
         if not repairing:
             statement_timeout = int(source_config.get('db-statement-timeout', 0))
             if statement_timeout > 0: