From ca9f696c8c7b8f58f7e65a74c1ddc425c387b4ba Mon Sep 17 00:00:00 2001 From: James Vega Date: Mon, 19 Apr 2004 15:16:31 +0000 Subject: [PATCH] Weed out the last of the floating point COUNT bugs --- plugins/Infobot.py | 4 ++-- plugins/URL.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/Infobot.py b/plugins/Infobot.py index e867f4f0b..24a9827cc 100755 --- a/plugins/Infobot.py +++ b/plugins/Infobot.py @@ -171,9 +171,9 @@ class Infobot(callbacks.PrivmsgRegexp): r"^info$" cursor = self.db.cursor() cursor.execute("SELECT COUNT(*) FROM is_factoids") - numIs = cursor.fetchone()[0] + numIs = int(cursor.fetchone()[0]) cursor.execute("SELECT COUNT(*) FROM are_factoids") - numAre = cursor.fetchone()[0] + numAre = int(cursor.fetchone()[0]) s = 'I have %s is factoids and %s are factoids' % (numIs, numAre) irc.reply(s) diff --git a/plugins/URL.py b/plugins/URL.py index a86aeae78..4137560b1 100644 --- a/plugins/URL.py +++ b/plugins/URL.py @@ -309,8 +309,9 @@ class URL(callbacks.PrivmsgCommandAndRegexp, cursor = db.cursor() cursor.execute("""SELECT COUNT(*) FROM urls""") (count,) = cursor.fetchone() + count = int(count) irc.reply('I have %s %s in my database.' % - (count, int(count) == 1 and 'URL' or 'URLs')) + (count, count == 1 and 'URL' or 'URLs')) def last(self, irc, msg, args): """[] [--{from,with,at,proto,near}=] --{nolimit,fancy}