gh-103791: handle BaseExceptionGroup in contextlib.suppress() (#111910)

This commit is contained in:
Zac Hatfield-Dodds 2023-11-10 08:32:36 -05:00 committed by GitHub
parent 64fea3211d
commit d61313bdb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 4 deletions

View file

@ -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