Merge pull request #1086 from glutanimate/abort-addon-import-exception

Add an exception that allows add-ons to abort early
This commit is contained in:
Damien Elmes 2021-03-23 19:28:13 +10:00 committed by GitHub
commit 2d48479f4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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(