Kaydet (Commit) cf279477 authored tarafından Bahadır Kandemir's avatar Bahadır Kandemir

Do nothing if locale is None

üst 397c45ec
......@@ -156,9 +156,12 @@ class Link:
def setLocale(self):
try:
lang = locale.getdefaultlocale()[0].split("_")[0]
obj = self.bus.get_object(self.address, '/', introspect=False)
obj.setLocale(lang, dbus_interface=self.interface)
code, encoding = locale.getdefaultlocale()
if code:
if "_" in code:
code = code.split("_")[0]
obj = self.bus.get_object(self.address, '/', introspect=False)
obj.setLocale(code, dbus_interface=self.interface)
except dbus.DBusException, exception:
pass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment