# HG changeset patch # User Laurent Peuch # Date 1575567638 -3600 # Node ID 6cbb1e2a6e49f33451f5b026ee2f7c80d264cb88 # Parent fb0936668535f2da74bbd485a27154d1ca1d9eea [refactoring] class variable is useless diff -r fb0936668535 -r 6cbb1e2a6e49 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: