From b5c840e6720b5a26c05d67c26abc65bec5132787 Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Thu, 31 Dec 2009 00:45:42 +0000 Subject: Do not fail if LANG wasn't set --- diff --git a/lessons.py b/lessons.py index 2766e0b..35a6922 100644 --- a/lessons.py +++ b/lessons.py @@ -66,7 +66,8 @@ class View(gtk.EventBox): self.show_all() -_lang = locale.getdefaultlocale()[0].split('_')[0] +_locale = locale.getdefaultlocale()[0] +_lang = _locale and _locale.split('_')[0] or 'en' if not os.path.isdir(theme.path('lessons', _lang)): logging.info('Cannot find lessons for language %s, thus use en' % _lang) -- cgit v0.9.1