mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-103791: handle BaseExceptionGroup
in contextlib.suppress()
(#111910)
This commit is contained in:
parent
64fea3211d
commit
d61313bdb1
4 changed files with 25 additions and 4 deletions
|
@ -461,7 +461,7 @@ class suppress(AbstractContextManager):
|
|||
return
|
||||
if issubclass(exctype, self._exceptions):
|
||||
return True
|
||||
if issubclass(exctype, ExceptionGroup):
|
||||
if issubclass(exctype, BaseExceptionGroup):
|
||||
match, rest = excinst.split(self._exceptions)
|
||||
if rest is None:
|
||||
return True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue