changeset 772:c91c613ae6d0 pyntnclick

The locale may be None, apparently
author Stefano Rivera <stefano@rivera.za.net>
date Sat, 26 Jan 2013 17:14:35 +0200
parents 1c8f8302e990
children c5ffb5418b03
files pyntnclick/main.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pyntnclick/main.py	Sat Jan 26 17:03:20 2013 +0200
+++ b/pyntnclick/main.py	Sat Jan 26 17:14:35 2013 +0200
@@ -66,7 +66,7 @@
 
         locale.setlocale(locale.LC_ALL, "")
         lang = locale.getlocale()[0]
-        if '_' in lang:
+        if lang and '_' in lang:
             lang = lang.split('_', 1)[0]
         self.resource = Resources(self._resource_module, lang)
         gettext.bindtextdomain(self.constants.i18n_name,