diff --git a/src/calibre/customize/zipplugin.py b/src/calibre/customize/zipplugin.py index 02764ca09b..d7e5b759e9 100644 --- a/src/calibre/customize/zipplugin.py +++ b/src/calibre/customize/zipplugin.py @@ -248,7 +248,11 @@ class CalibrePluginFinder: fullname_in_plugin += '.__init__' else: return - is_package = fullname.count('.') < 2 or fullname == '__init__' or fullname.endswith('__init__') + is_package = bool( + fullname.count('.') < 2 or + fullname_in_plugin == '__init__' or + (fullname_in_plugin and fullname_in_plugin.endswith('__init__')) + ) if zip_file_path: filename = posixpath.join(zip_file_path, *fullname_in_plugin.split('.')) + '.py'