Used super().execute/executemany() in SQLiteCursorWrapper.

This commit is contained in:
Nick Pope 2022-11-08 13:19:59 +00:00 committed by GitHub
parent c4eaa67e2b
commit e0fb2a25b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -371,11 +371,11 @@ class SQLiteCursorWrapper(Database.Cursor):
def execute(self, query, params=None): def execute(self, query, params=None):
if params is None: if params is None:
return Database.Cursor.execute(self, query) return super().execute(query)
# Extract names if params is a mapping, i.e. "pyformat" style is used. # Extract names if params is a mapping, i.e. "pyformat" style is used.
param_names = list(params) if isinstance(params, Mapping) else None param_names = list(params) if isinstance(params, Mapping) else None
query = self.convert_query(query, param_names=param_names) query = self.convert_query(query, param_names=param_names)
return Database.Cursor.execute(self, query, params) return super().execute(query, params)
def executemany(self, query, param_list): def executemany(self, query, param_list):
# Extract names if params is a mapping, i.e. "pyformat" style is used. # Extract names if params is a mapping, i.e. "pyformat" style is used.
@ -386,7 +386,7 @@ class SQLiteCursorWrapper(Database.Cursor):
else: else:
param_names = None param_names = None
query = self.convert_query(query, param_names=param_names) query = self.convert_query(query, param_names=param_names)
return Database.Cursor.executemany(self, query, param_list) return super().executemany(query, param_list)
def convert_query(self, query, *, param_names=None): def convert_query(self, query, *, param_names=None):
if param_names is None: if param_names is None: