mirror of
https://github.com/ankitects/anki.git
synced 2026-01-07 02:53:54 -05:00
Use CardTypeError from anki.errors module
This commit is contained in:
parent
6d1dcbb99a
commit
c2ebd092f2
1 changed files with 2 additions and 2 deletions
|
|
@ -14,7 +14,7 @@ from markdown import markdown
|
|||
|
||||
import aqt
|
||||
from anki.collection import HelpPage
|
||||
from anki.errors import BackendError, Interrupted
|
||||
from anki.errors import BackendError, CardTypeError, Interrupted
|
||||
from anki.utils import is_win
|
||||
from aqt.addons import AddonManager, AddonMeta
|
||||
from aqt.qt import *
|
||||
|
|
@ -41,7 +41,7 @@ def show_exception(*, parent: QWidget, exception: Exception) -> None:
|
|||
text_format = Qt.TextFormat.PlainText
|
||||
|
||||
# set CardTypeError messages as rich text to allow HTML formatting
|
||||
if type(exception).__name__ == "CardTypeError":
|
||||
if isinstance(exception, CardTypeError):
|
||||
text_format = Qt.TextFormat.RichText
|
||||
|
||||
if isinstance(exception, BackendError):
|
||||
|
|
|
|||
Loading…
Reference in a new issue