From 0f734719e7ac9660b6337ade6e8dfa679cce534f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 4 Apr 2022 19:09:13 +0530 Subject: [PATCH] ... --- kitty/main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kitty/main.py b/kitty/main.py index 6b016da77..0a607956e 100644 --- a/kitty/main.py +++ b/kitty/main.py @@ -338,11 +338,11 @@ def set_locale() -> None: locale.setlocale(locale.LC_ALL, '') except Exception: log_error('Failed to set locale with LANG:', os.environ.get('LANG')) - os.environ.pop('LANG', None) - try: - locale.setlocale(locale.LC_ALL, '') - except Exception: - log_error('Failed to set locale with no LANG') + if os.environ.pop('LANG', None) is not None: + try: + locale.setlocale(locale.LC_ALL, '') + except Exception: + log_error('Failed to set locale with no LANG') def _main() -> None: