File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -90,8 +90,13 @@ The following exceptions are used mostly as base classes for other exceptions.
9090 .. method :: with_traceback(tb)
9191
9292 This method sets *tb * as the new traceback for the exception and returns
93- the exception object. It is usually used in exception handling code like
94- this::
93+ the exception object. It was more commonly used before the exception
94+ chaining features of :pep: `3134 ` became available. The following example
95+ shows how we can convert an instance of ``SomeException `` into an
96+ instance of ``OtherException `` while preserving the traceback. Once
97+ raised, the current frame is pushed onto the traceback of the
98+ ``OtherException ``, as would have happened to the traceback of the
99+ original ``SomeException `` had we allowed it to propagate to the caller.
95100
96101 try:
97102 ...
You can’t perform that action at this time.
0 commit comments