Uses dict setdefault instead of manually checking if key-value pair exists. (#1657)

This commit is contained in:
Himadri Bhattacharjee 2023-02-28 14:46:38 +00:00 committed by GitHub
parent b41d701727
commit 2559e0dc10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -221,11 +221,8 @@ def load_config():
selected_region = arguments.get('mirror-region', None) selected_region = arguments.get('mirror-region', None)
arguments['mirror-region'] = {selected_region: list_mirrors()[selected_region]} arguments['mirror-region'] = {selected_region: list_mirrors()[selected_region]}
if arguments.get('sys-language', None) is not None: arguments.setdefault('sys-language', 'en_US')
arguments['sys-language'] = arguments.get('sys-language', 'en_US') arguments.setdefault('sys-encoding', 'utf-8')
if arguments.get('sys-encoding', None) is not None:
arguments['sys-encoding'] = arguments.get('sys-encoding', 'utf-8')
if arguments.get('gfx_driver', None) is not None: if arguments.get('gfx_driver', None) is not None:
storage['gfx_driver_packages'] = AVAILABLE_GFX_DRIVERS.get(arguments.get('gfx_driver', None), None) storage['gfx_driver_packages'] = AVAILABLE_GFX_DRIVERS.get(arguments.get('gfx_driver', None), None)