From aa06588ee2bfffd38107a80181b14ca1c4a17694 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Wed, 29 Dec 2010 16:23:29 +0100 Subject: gcalc: Check for self.irc in __init__(). --- modules/gcalc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gcalc.py b/modules/gcalc.py index 6abee92..ea317af 100644 --- a/modules/gcalc.py +++ b/modules/gcalc.py @@ -9,7 +9,8 @@ import urllib, urllib2, json class Module: def __init__(self, bot): self.irc = bot - self.irc.register_keyword('!gcalc', self) + if self.irc: + self.irc.register_keyword('!gcalc', self) def calc(self, s): url = 'http://www.google.com/ig/calculator?%s' % urllib.urlencode({'q': s}) -- cgit v1.2.3