Allow tuple of exceptions in ExceptionInfo.errisinstance
isinstance() accepts it and some code does pass a tuple.
Fixup for commit 55a570e513
.
This commit is contained in:
parent
104f8fc836
commit
8d413c1926
|
@ -520,7 +520,9 @@ class ExceptionInfo(Generic[_E]):
|
|||
text = text[len(self._striptext) :]
|
||||
return text
|
||||
|
||||
def errisinstance(self, exc: "Type[BaseException]") -> bool:
|
||||
def errisinstance(
|
||||
self, exc: Union["Type[BaseException]", Tuple["Type[BaseException]", ...]]
|
||||
) -> bool:
|
||||
""" return True if the exception is an instance of exc """
|
||||
return isinstance(self.value, exc)
|
||||
|
||||
|
|
Loading…
Reference in New Issue