From aeaad9056cd1a7b91bfb16e205b12ebc2adb29cc Mon Sep 17 00:00:00 2001 From: James Vega Date: Sun, 22 May 2005 21:01:16 +0000 Subject: [PATCH] plugins/Time: Make sure the Time commands are nested-safe, i.e. they reply with strings. --- plugins/Time/plugin.py | 2 +- plugins/Time/test.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/Time/plugin.py b/plugins/Time/plugin.py index 81037d95f..ca4f41faa 100644 --- a/plugins/Time/plugin.py +++ b/plugins/Time/plugin.py @@ -112,7 +112,7 @@ class Time(callbacks.Plugin): if new != now: if new - now < 0: new += 86400 - irc.reply(new-now) + irc.reply(str(new-now)) else: irc.error('That\'s right now!') until = wrap(until, ['text']) diff --git a/plugins/Time/test.py b/plugins/Time/test.py index 0977eae8a..3078e8bab 100644 --- a/plugins/Time/test.py +++ b/plugins/Time/test.py @@ -51,6 +51,11 @@ class TimeTestCase(PluginTestCase): self.assertNotError('ctime') self.assertNotError('time %Y') + def testNoNestedErrors(self): + self.assertNotError('echo [until 4:00]') + self.assertNotError('echo [at now]') + self.assertNotError('echo [seconds 4m]') + # vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: