From 4b08d639b7b7f6e7b29d2208f1f33be56139948f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Kubo=C5=84?= <g_kubon@e-science.pl> Date: Thu, 16 Mar 2023 14:22:43 +0000 Subject: [PATCH] fix to_dict methods for tests --- plwn/storages/sqlite.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plwn/storages/sqlite.py b/plwn/storages/sqlite.py index 781c5cc..4405789 100644 --- a/plwn/storages/sqlite.py +++ b/plwn/storages/sqlite.py @@ -787,7 +787,11 @@ class LexicalUnit(bs.LexicalUnitBase): u"SELECT quote(id) from tbl_lexicalunit WHERE id = ?", (self._id,), ) - self._uuid = cur.fetchone()[0][2:-1] + temp = cur.fetchone()[0] + if isinstance(temp, str): + self._uuid = temp[2:-1] + else: + self._uuid = temp return self._uuid @property @@ -1150,7 +1154,11 @@ class Synset(bs.SynsetBase): u"SELECT quote(id) from tbl_synset WHERE id = ?", (self._id,), ) - self._uuid = cur.fetchone()[0][2:-1] + temp = cur.fetchone()[0] + if isinstance(temp, str): + self._uuid = temp[2:-1] + else: + self._uuid = temp return self._uuid @property -- GitLab