From c283f85d739c955999a81eedefaef714de7a4277 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 19 Dec 2021 21:39:01 +0530 Subject: [PATCH] Fix aliasing of PyQt5 imports --- src/calibre/constants.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/constants.py b/src/calibre/constants.py index 0029cb9a33..eced47ceaf 100644 --- a/src/calibre/constants.py +++ b/src/calibre/constants.py @@ -203,8 +203,10 @@ class DeVendor: return find_spec('feedparser') if fullname.startswith('calibre.ebooks.markdown'): return ModuleSpec(fullname, DeVendorLoader(fullname[len('calibre.ebooks.'):])) - if fullname.startswith('PyQt5.'): + if fullname.startswith('PyQt5'): # this is present for third party plugin compat + if fullname == 'PyQt5': + return ModuleSpec(fullname, DeVendorLoader('qt')) return ModuleSpec(fullname, DeVendorLoader('qt.webengine' if 'QWebEngine' in fullname else 'qt.core')) if fullname.startswith('Cryptodome'): # this is needed for py7zr which uses pycryptodomex instead of