Fix aliasing of PyQt5 imports

This commit is contained in:
Kovid Goyal 2021-12-19 21:39:01 +05:30
parent 0bad6416a8
commit c283f85d73
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -203,8 +203,10 @@ class DeVendor:
return find_spec('feedparser') return find_spec('feedparser')
if fullname.startswith('calibre.ebooks.markdown'): if fullname.startswith('calibre.ebooks.markdown'):
return ModuleSpec(fullname, DeVendorLoader(fullname[len('calibre.ebooks.'):])) return ModuleSpec(fullname, DeVendorLoader(fullname[len('calibre.ebooks.'):]))
if fullname.startswith('PyQt5.'): if fullname.startswith('PyQt5'):
# this is present for third party plugin compat # 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')) return ModuleSpec(fullname, DeVendorLoader('qt.webengine' if 'QWebEngine' in fullname else 'qt.core'))
if fullname.startswith('Cryptodome'): if fullname.startswith('Cryptodome'):
# this is needed for py7zr which uses pycryptodomex instead of # this is needed for py7zr which uses pycryptodomex instead of