File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 39
39
40
40
try :
41
41
import rich
42
- from rich .console import Console
43
42
from rich .traceback import Traceback
44
43
45
- console_stderr = Console (stderr = True )
44
+ from . import rich_utils
45
+
46
+ console_stderr = rich_utils ._get_rich_console (stderr = True )
46
47
47
48
except ImportError : # pragma: no cover
48
49
rich = None # type: ignore
@@ -70,12 +71,15 @@ def except_hook(
70
71
supress_internal_dir_names = [typer_path , click_path ]
71
72
exc = exc_value
72
73
if rich :
74
+ from .rich_utils import MAX_WIDTH
75
+
73
76
rich_tb = Traceback .from_exception (
74
77
type (exc ),
75
78
exc ,
76
79
exc .__traceback__ ,
77
80
show_locals = exception_config .pretty_exceptions_show_locals ,
78
81
suppress = supress_internal_dir_names ,
82
+ width = MAX_WIDTH ,
79
83
)
80
84
console_stderr .print (rich_tb )
81
85
return
You can’t perform that action at this time.
0 commit comments