[PATCH] Adapt to the new libxklavier's behaviour
Vratislav Podzimek
vpodzime at redhat.com
Thu Mar 7 15:24:47 UTC 2013
libxklavier now returns lists of ordinal numbers of chars instead of
null-byte terminated strings.
Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
pyanaconda/keyboard.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/keyboard.py b/pyanaconda/keyboard.py
index fc4914a..6407b98 100755
--- a/pyanaconda/keyboard.py
+++ b/pyanaconda/keyboard.py
@@ -292,8 +292,9 @@ def activate_keyboard(keyboard):
def item_str(s):
"""Convert a zero-terminated byte array to a proper str"""
- i = s.find(b'\x00')
- return s[:i].decode("utf-8") #there are some non-ascii layout descriptions
+ i = s.index(0)
+ s = "".join(chr(char) for char in s[:i])
+ return s.decode("utf-8") #there are some non-ascii layout descriptions
class _Layout(object):
"""Internal class representing a single layout variant"""
--
1.7.11.7
More information about the anaconda-patches
mailing list