mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-134565: Use ExceptionGroup to handle multiple errors in unittest.doModuleCleanups() (GH-134566)
This commit is contained in:
parent
77eade39f9
commit
393773ae87
5 changed files with 101 additions and 15 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue