From 0587cc8b1d1f6343d2583e1f515b243d7678ec89 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 23 Jan 2015 15:06:51 +0100 Subject: [PATCH] Really fix pylint and unicodedata.category. --- qutebrowser/keyinput/basekeyparser.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/qutebrowser/keyinput/basekeyparser.py b/qutebrowser/keyinput/basekeyparser.py index 214d98805..03063f9b2 100644 --- a/qutebrowser/keyinput/basekeyparser.py +++ b/qutebrowser/keyinput/basekeyparser.py @@ -164,8 +164,13 @@ class BaseKeyParser(QObject): self._keystring = '' return - if ((not txt) or # pylint: disable=no-member - unicodedata.category(txt) == 'Cc'): # control chars + if len(txt) == 1: + category = unicodedata.category(txt) # pylint: disable=no-member + is_control_char = (category == 'Cc') + else: + is_control_char = False + + if ((not txt) or is_control_char): self._debug_log("Ignoring, no text char") return False