From 69b011ac129e293f773bfec236811e738564f155 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sun, 1 Jun 2014 02:48:51 -0400 Subject: [PATCH] Fix. --- bitshift/database/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bitshift/database/__init__.py b/bitshift/database/__init__.py index c5dfc19..c1e6c2e 100644 --- a/bitshift/database/__init__.py +++ b/bitshift/database/__init__.py @@ -175,9 +175,9 @@ class Database(object): cache_hit = cursor.fetchall() if cache_hit: cursor.execute(query2, (cache_id,)) - results = cursor.fetchall() - num_results = results[0][1] * (10 ** results[0][2]) - ids = [res[0] for res in results] + rows = cursor.fetchall() + num_results = rows[0][1] * (10 ** rows[0][2]) if rows else 0 + ids = [row[0] for row in rows] else: ids, num_results = self._search_with_query(cursor, query, page) num_exp = max(len(str(num_results)) - 3, 0)