Catch errors when using an unsupported locale

This commit is contained in:
Mathieu Comandon 2017-09-27 21:14:01 -07:00
parent c47a66a81a
commit c332fc8d03

View file

@ -24,7 +24,11 @@ if LAUNCH_PATH != "/usr/bin":
SOURCE_PATH = normpath(os.path.join(LAUNCH_PATH, '..'))
sys.path.insert(0, SOURCE_PATH)
locale.setlocale(locale.LC_ALL, locale.getlocale())
try:
locale_name = locale.getlocale()
locale.setlocale(locale.LC_ALL, locale_name)
except locale.Error:
sys.stderr.write("Unsupported locale %s\n" % locale_name)
from lutris.gui.application import Application