Add an exception that allows add-ons to abort early

This commit is contained in:
Glutanimate 2021-03-08 03:40:15 +01:00
parent b1f4ea562a
commit fa6a0a1283

View File

@ -46,6 +46,10 @@ from aqt.utils import (
)
class AbortAddonImport(Exception):
"""Add-ons may raise this exception to abort their import"""
@dataclass
class InstallOk:
name: str
@ -211,6 +215,8 @@ class AddonManager:
self.dirty = True
try:
__import__(addon.dir_name)
except AbortAddonImport:
pass
except:
showWarning(
tr(