Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/locale_helpers.py
diff options
context:
space:
mode:
Diffstat (limited to 'archinstall/lib/locale_helpers.py')
-rw-r--r--archinstall/lib/locale_helpers.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/archinstall/lib/locale_helpers.py b/archinstall/lib/locale_helpers.py
index d1fb4562..efb0365f 100644
--- a/archinstall/lib/locale_helpers.py
+++ b/archinstall/lib/locale_helpers.py
@@ -1,7 +1,7 @@
import logging
from typing import Iterator, List, Callable, Optional
-from .exceptions import ServiceException
+from .exceptions import ServiceException, SysCallError
from .general import SysCommand
from .output import log
from .storage import storage
@@ -161,8 +161,10 @@ def set_keyboard_language(locale :str) -> bool:
log(f"Invalid keyboard locale specified: {locale}", fg="red", level=logging.ERROR)
return False
- if (output := SysCommand(f'localectl set-keymap {locale}')).exit_code != 0:
- raise ServiceException(f"Unable to set locale '{locale}' for console: {output}")
+ try:
+ SysCommand(f'localectl set-keymap {locale}')
+ except SysCallError as error:
+ raise ServiceException(f"Unable to set locale '{locale}' for console: {error}")
return True