File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -75,11 +75,12 @@ def collect_unraisable() -> None:
7575 try :
7676 warnings .warn (pytest .PytestUnraisableExceptionWarning (msg ))
7777 except pytest .PytestUnraisableExceptionWarning as e :
78- # exceptions have a better way to show the traceback, but
79- # warnings do not, so hide the traceback from the msg and
80- # set the cause so the traceback shows up in the right place
81- e .args = (meta .cause_msg ,)
82- e .__cause__ = meta .exc_value
78+ if meta .exc_value is not None :
79+ # exceptions have a better way to show the traceback, but
80+ # warnings do not, so hide the traceback from the msg and
81+ # set the cause so the traceback shows up in the right place
82+ e .args = (meta .cause_msg ,)
83+ e .__cause__ = meta .exc_value
8384 errors .append (e )
8485
8586 if len (errors ) == 1 :
You can’t perform that action at this time.
0 commit comments