File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import collections
22import importlib
33import importlib .util
4- import inspect
54import os
65import pathlib
76import sys
87import textwrap
8+ import traceback
99from typing import Union
1010
1111import click
@@ -199,17 +199,16 @@ def group(ctx):
199199
200200 try :
201201 group ()
202- except Exception as e :
202+ except Exception :
203203 click .secho (
204- textwrap .dedent (
205- f"""\
206-
207- { type (e ).__name__ } : { e }
208-
209- This exception was raised from:
210-
211- { inspect .trace ()[- 1 ].filename }
204+ "\n " + "" .join (traceback .format_exception (* sys .exc_info (), limit = - 1 )),
205+ fg = "red" ,
206+ bold = True ,
207+ file = sys .stderr ,
208+ )
212209
210+ click .secho (
211+ textwrap .dedent (f"""\
213212 If you suspect this is a bug in `spin`, please file a report at:
214213
215214 https://github.com/scientific-python/spin
@@ -218,9 +217,8 @@ def group(ctx):
218217
219218 spin: { __version__ } , package: { proj_name }
220219
221- Aborting."""
222- ),
223- fg = "red" ,
220+ Aborting.""" ),
221+ fg = "yellow" ,
224222 bold = True ,
225223 file = sys .stderr ,
226224 )
You can’t perform that action at this time.
0 commit comments