From 2559e0dc10a34735e6f694e7edc33c7e4eec0778 Mon Sep 17 00:00:00 2001 From: Himadri Bhattacharjee <107522312+lavafroth@users.noreply.github.com> Date: Tue, 28 Feb 2023 14:46:38 +0000 Subject: Uses dict setdefault instead of manually checking if key-value pair exists. (#1657) --- archinstall/__init__.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'archinstall') diff --git a/archinstall/__init__.py b/archinstall/__init__.py index 6a4c768e..bb1b9405 100644 --- a/archinstall/__init__.py +++ b/archinstall/__init__.py @@ -221,11 +221,8 @@ def load_config(): selected_region = arguments.get('mirror-region', None) arguments['mirror-region'] = {selected_region: list_mirrors()[selected_region]} - if arguments.get('sys-language', None) is not None: - arguments['sys-language'] = arguments.get('sys-language', 'en_US') - - if arguments.get('sys-encoding', None) is not None: - arguments['sys-encoding'] = arguments.get('sys-encoding', 'utf-8') + arguments.setdefault('sys-language', 'en_US') + arguments.setdefault('sys-encoding', 'utf-8') if arguments.get('gfx_driver', None) is not None: storage['gfx_driver_packages'] = AVAILABLE_GFX_DRIVERS.get(arguments.get('gfx_driver', None), None) -- cgit v1.2.3-70-g09d2