New submission from Terry J. Reedy :
.../Doc/library/exceptions.rst, lines 99-105 has
original ``SomeException`` had we allowed it to propagate to the caller.
try:
...
except SomeException:
tb = sys.exc_info()[2]
raise OtherException(...).with_traceback(tb)
The code example with no markup except indents does not work because without a new indent, the last line is merged with the preceding one as part of the same paragraph.
https://docs.python.org/3.10/library/exceptions.html#BaseException.with_trac...
traceback of the original SomeException had we allowed it to propagate to the caller.
try:
…
except SomeException:
tb = sys.exc_info()[2] raise OtherException(…).with_traceback(tb)
Note also the uneven line spacing, which is different for me here with Firefox that in the web page (also with Firefox). Something different is needed, but I do not know what.
----------
assignee: docs@python
components: Documentation
messages: 392871
nosy: docs@python, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Markup with_traceback code example
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9
_______________________________________
Python tracker
https://bugs.python.org/issue44030
_______________________________________