diff --git a/python-programming/detect_locale.py b/python-programming/detect_locale.py index fafa06f..c0834a3 100644 --- a/python-programming/detect_locale.py +++ b/python-programming/detect_locale.py @@ -8,7 +8,7 @@ from typing import Optional -from os import name as os_name +from os import environ, name as os_name if os_name == "nt": from ctypes import windll from locale import windows_locale @@ -16,7 +16,7 @@ if os_name == "nt": def detect_locale() -> Optional[str]: if os_name == "posix": - return os.environ["LANG"] + return environ["LANG"] if os_name == "nt": return windows_locale[windll.kernel32.GetUserDefaultUILanguage()] return None