From d5241eb07aeadd76a4b024318248d46d27ce1633 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Fri, 22 Oct 2004 20:53:35 +0000 Subject: [PATCH] No errors on exit when google.py fails to import. --- plugins/Google.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/plugins/Google.py b/plugins/Google.py index 34441d4c3..cf85b7aa4 100644 --- a/plugins/Google.py +++ b/plugins/Google.py @@ -51,6 +51,7 @@ import supybot.registry as registry import supybot.conf as conf import supybot.utils as utils +import supybot.world as world from supybot.commands import * import supybot.ircmsgs as ircmsgs import supybot.plugins as plugins @@ -141,12 +142,14 @@ class LicenseKey(registry.String): if s: google.setLicense(self.value) except AttributeError: - raise callbacks.Error, 'It appears that the initial import of ' \ - 'our underlying google.py module has ' \ - 'failed. Once the cause of that problem ' \ - 'has been diagnosed and fixed, the bot ' \ - 'will need to be restarted in order to ' \ - 'load this plugin.' + if not world.dying: + raise callbacks.Error, \ + 'It appears that the initial import of ' \ + 'our underlying google.py module has ' \ + 'failed. Once the cause of that problem ' \ + 'has been diagnosed and fixed, the bot ' \ + 'will need to be restarted in order to ' \ + 'load this plugin.' class Language(registry.OnlySomeStrings): validStrings = ['lang_' + s for s in 'ar zh-CN zh-TW cs da nl en et fi fr '