gh-134565: Use ExceptionGroup to handle multiple errors in unittest.doModuleCleanups() (GH-134566)

This commit is contained in:
Serhiy Storchaka 2025-05-23 21:07:49 +03:00 committed by GitHub
parent 77eade39f9
commit 393773ae87
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 101 additions and 15 deletions

View file

@ -149,9 +149,7 @@ def doModuleCleanups():
except Exception as exc:
exceptions.append(exc)
if exceptions:
# Swallows all but first exception. If a multi-exception handler
# gets written we should use that here instead.
raise exceptions[0]
raise ExceptionGroup('module cleanup failed', exceptions)
def skip(reason):