From 50ad59a6c85054fac92c9ccfc00da891253f8b88 Mon Sep 17 00:00:00 2001 From: Jakub Kuczys Date: Thu, 6 Feb 2025 02:31:03 +0100 Subject: [PATCH] Catch TypeError when setting global locale (#6518) --- redbot/core/bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redbot/core/bot.py b/redbot/core/bot.py index f322595bd..bac5afcbc 100644 --- a/redbot/core/bot.py +++ b/redbot/core/bot.py @@ -1147,7 +1147,7 @@ class Red( i18n_locale = await self._config.locale() try: _i18n.set_global_locale(i18n_locale) - except ValueError: + except (ValueError, TypeError): log.warning( "The bot's global locale was set to an invalid value (%r)" " and will be reset to default (%s).", @@ -1159,7 +1159,7 @@ class Red( i18n_regional_format = await self._config.regional_format() try: _i18n.set_global_regional_format(i18n_regional_format) - except ValueError: + except (ValueError, TypeError): log.warning( "The bot's global regional format was set to an invalid value (%r)" " and will be reset to default (which is to inherit global locale, i.e. %s).",