From 1fa68f939734ebf8f3239652be40e5745a5d0794 Mon Sep 17 00:00:00 2001 From: "Huska, Matthew" Date: Mon, 30 Oct 2023 15:42:20 +0100 Subject: [PATCH] Fix TypeError: cannot unpack non-iterable int object when using --count --- lib/sonardb.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/sonardb.py b/lib/sonardb.py index 4384307..e29d68e 100755 --- a/lib/sonardb.py +++ b/lib/sonardb.py @@ -2001,7 +2001,9 @@ def match( cursor = self.cursor.execute(sql, where_vals) column_names = [description[0] for description in cursor.description] - return cursor.fetchall(), column_names + rows = cursor.fetchall() + + return rows, column_names # UPDATE DATA @@ -3479,7 +3481,7 @@ def match( rows[i]["aa_profile"], self.iupac_explicit_aa_code, keep ) elif count: - return rows[0]["count"] + return rows[0]["count"], "count" return rows, column_names