Commits

Yuya Nishihara committed 6581692

qscilib: try to remove Ctrl+L key binding only if possible (fixes #2218)

Comments (0)

Files changed (1)

tortoisehg/hgqt/qscilib.py

         return False
 
 def unbindConflictedKeys(sci):
-    sci.standardCommands().boundTo(QKeySequence('CTRL+L')).setKey(0)
+    cmdset = sci.standardCommands()
+    try:
+        cmd = cmdset.boundTo(QKeySequence('CTRL+L'))
+        if cmd:
+            cmd.setKey(0)
+    except AttributeError:  # old QScintilla does not have boundTo()
+        pass
 
 def qsciEolModeFromOs():
     if os.name.startswith('nt'):