From 4b0d50c19334d16bcf27bd352aa2b4dc8dcf4d05 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 19 Mar 2022 20:03:50 -0700 Subject: [PATCH] Add isinstance check for sqlite3.Row. --- voussoirkit/worms.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/voussoirkit/worms.py b/voussoirkit/worms.py index 6b02a87..9e17013 100644 --- a/voussoirkit/worms.py +++ b/voussoirkit/worms.py @@ -5,6 +5,7 @@ import abc import functools import random import re +import sqlite3 import typing from voussoirkit import sqlhelpers @@ -433,7 +434,7 @@ class DatabaseWithCaching(Database, metaclass=abc.ABCMeta): object_table = object_class.table object_cache = self.caches.get(object_class, None) - if isinstance(db_row, dict): + if isinstance(db_row, (dict, sqlite3.Row)): object_id = db_row['id'] else: object_index = self.COLUMN_INDEX[object_table]