summaryrefslogtreecommitdiffstats
path: root/Doc/library/exceptions.rst
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2023-02-20 21:54:19 (GMT)
committerGitHub <noreply@github.com>2023-02-20 21:54:19 (GMT)
commit4d3bc89a3f54c4f09756a9b644b3912bf54191a7 (patch)
tree2497cec92c8a3935c3a66efbb3a123ff204e6f8f /Doc/library/exceptions.rst
parent36854bbb240e417c0df6f0014924fcc899388186 (diff)
downloadcpython-4d3bc89a3f54c4f09756a9b644b3912bf54191a7.zip
cpython-4d3bc89a3f54c4f09756a9b644b3912bf54191a7.tar.gz
cpython-4d3bc89a3f54c4f09756a9b644b3912bf54191a7.tar.bz2
gh-102011: use sys.exception() instead of sys.exc_info() in docs where possible (#102012)
Diffstat (limited to 'Doc/library/exceptions.rst')
-rw-r--r--Doc/library/exceptions.rst2
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst
index 1217b81..4a57e9c 100644
--- a/Doc/library/exceptions.rst
+++ b/Doc/library/exceptions.rst
@@ -123,7 +123,7 @@ The following exceptions are used mostly as base classes for other exceptions.
try:
...
except SomeException:
- tb = sys.exc_info()[2]
+ tb = sys.exception().__traceback__
raise OtherException(...).with_traceback(tb)
.. method:: add_note(note)