Fix "Add-ons possibly involved" message never appearing on Windows (#2536)

This commit is contained in:
Abdo 2023-06-07 08:09:18 +03:00 committed by GitHub
parent fadeb99c99
commit 7044f0c53c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -251,12 +251,13 @@ class ErrorHandler(QObject):
sys.exit(1)
def _addonText(self, error: str) -> str:
matches = re.findall(r"addons21/(.*?)/", error)
matches = re.findall(r"addons21(/|\\)(.*?)(/|\\)", error)
if not matches:
return ""
# reverse to list most likely suspect first, dict to deduplicate:
addons = [
aqt.mw.addonManager.addonName(i) for i in dict.fromkeys(reversed(matches))
aqt.mw.addonManager.addonName(i[1])
for i in dict.fromkeys(reversed(matches))
]
# highlight importance of first add-on:
addons[0] = f"<b>{addons[0]}</b>"