@@ -218,7 +218,7 @@ The module also defines the following classes:
218
218
:class: `TracebackException ` objects are created from actual exceptions to
219
219
capture data for later printing in a lightweight fashion.
220
220
221
- .. class :: TracebackException(exc_type, exc_value, exc_traceback, *, limit=None, lookup_lines=True, capture_locals=False, compact=False)
221
+ .. class :: TracebackException(exc_type, exc_value, exc_traceback, *, limit=None, lookup_lines=True, capture_locals=False, compact=False, max_group_width=15, max_group_depth=10 )
222
222
223
223
Capture an exception for later rendering. *limit *, *lookup_lines * and
224
224
*capture_locals * are as for the :class: `StackSummary ` class.
@@ -230,6 +230,12 @@ capture data for later printing in a lightweight fashion.
230
230
231
231
Note that when locals are captured, they are also shown in the traceback.
232
232
233
+ *max_group_width * and *max_group_depth * control the formatting of exception
234
+ groups (see :exc: `BaseExceptionGroup `). The depth refers to the nesting
235
+ level of the group, and the width refers to the size of a single exception
236
+ group's exceptions array. The formatted output is truncated when either
237
+ limit is exceeded.
238
+
233
239
.. attribute :: __cause__
234
240
235
241
A :class: `TracebackException ` of the original ``__cause__ ``.
@@ -238,6 +244,14 @@ capture data for later printing in a lightweight fashion.
238
244
239
245
A :class: `TracebackException ` of the original ``__context__ ``.
240
246
247
+ .. attribute :: exceptions
248
+
249
+ If ``self `` represents an :exc: `ExceptionGroup `, this field holds a list of
250
+ :class: `TracebackException ` instances representing the nested exceptions.
251
+ Otherwise it is ``None ``.
252
+
253
+ .. versionadded :: 3.11
254
+
241
255
.. attribute :: __suppress_context__
242
256
243
257
The ``__suppress_context__ `` value from the original exception.
@@ -323,6 +337,9 @@ capture data for later printing in a lightweight fashion.
323
337
.. versionchanged :: 3.10
324
338
Added the *compact * parameter.
325
339
340
+ .. versionchanged :: 3.11
341
+ Added the *max_group_width * and *max_group_depth * parameters.
342
+
326
343
327
344
:class: `StackSummary ` Objects
328
345
-----------------------------
0 commit comments