From 5aefd6395fb8cecfca0bec5533e18676d8ae6f07 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Tue, 9 Nov 2021 22:33:23 +0100 Subject: [PATCH] Time: Fix error handling in @tztime. --- plugins/Time/plugin.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/Time/plugin.py b/plugins/Time/plugin.py index 5bb344c88..8053b1421 100644 --- a/plugins/Time/plugin.py +++ b/plugins/Time/plugin.py @@ -204,9 +204,11 @@ def tztime(self, irc, msg, args, timezone): except utils.time.UnknownTimeZone: irc.error(_('Unknown timezone')) except utils.time.MissingTimezoneLibrary: - irc.error(_('Python-tz is required by the command, but is not ' - 'installed on this computer.')) - except utils.time.UnknownTimeZone as e: + irc.error(_( + 'Timezone-related commands are not available. ' + 'Your administrator need to either upgrade Python to ' + 'version 3.9 or greater, or install pytz.')) + except utils.time.TimezoneException as e: irc.error(e.args[0]) else: format = self.registryValue("format", msg.channel, irc.network)