Time: Fix error handling in @tztime.

This commit is contained in:
Valentin Lorentz 2021-11-09 22:33:23 +01:00
parent 8326d6ef7f
commit 5aefd6395f
1 changed files with 5 additions and 3 deletions

View File

@ -204,9 +204,11 @@ class Time(callbacks.Plugin):
except utils.time.UnknownTimeZone: except utils.time.UnknownTimeZone:
irc.error(_('Unknown timezone')) irc.error(_('Unknown timezone'))
except utils.time.MissingTimezoneLibrary: except utils.time.MissingTimezoneLibrary:
irc.error(_('Python-tz is required by the command, but is not ' irc.error(_(
'installed on this computer.')) 'Timezone-related commands are not available. '
except utils.time.UnknownTimeZone as e: '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]) irc.error(e.args[0])
else: else:
format = self.registryValue("format", msg.channel, irc.network) format = self.registryValue("format", msg.channel, irc.network)