From 7242594594c861e1d311d7c9245a299e3ce03d21 Mon Sep 17 00:00:00 2001 From: Luca Baffa <47544021+lb803@users.noreply.github.com> Date: Thu, 6 Apr 2023 16:43:41 +0100 Subject: [PATCH] handle exception if client runs Calibre 6 or greater (this major relase switched PyQt5 -> PyQt6) --- config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config.py b/config.py index eb5ad1b..2f497bb 100644 --- a/config.py +++ b/config.py @@ -68,7 +68,11 @@ def __init__(self, *args, **kwargs): super(Completer, self).__init__(*args, **kwargs) self.setFilterMode(Qt.MatchContains) self.setCaseSensitivity(Qt.CaseInsensitive) - self.setCompletionMode(QCompleter.PopupCompletion) + try: + self.setCompletionMode(QCompleter.PopupCompletion) + except AttributeError: + # running calibre v 6.x.x or greater + self.setCompletionMode(QCompleter.CompletionMode.PopupCompletion) # Add texts instead of replace