[Python-checkins] bpo-6634: [doc] clarify that sys.exit() does not always exit the interpreter (GH-31639) (GH-31661)
iritkatriel
webhook-mailer at python.org
Thu Mar 3 10:16:35 EST 2022
https://github.com/python/cpython/commit/09819863a3fb7092ca5cbdfcb722882ebbac806b
commit: 09819863a3fb7092ca5cbdfcb722882ebbac806b
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: iritkatriel <1055913+iritkatriel at users.noreply.github.com>
date: 2022-03-03T15:16:23Z
summary:
bpo-6634: [doc] clarify that sys.exit() does not always exit the interpreter (GH-31639) (GH-31661)
(cherry picked from commit 10117f1d8cb49ce95493555c06050faf636ccee7)
Co-authored-by: vidhya <96202776+Vidhyavinu at users.noreply.github.com>
Co-authored-by: vidhya <96202776+Vidhyavinu at users.noreply.github.com>
files:
M Doc/library/sys.rst
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index 9e182826b7343..03986db16a78c 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -412,10 +412,7 @@ always available.
.. function:: exit([arg])
- Exit from Python. This is implemented by raising the :exc:`SystemExit`
- exception, so cleanup actions specified by finally clauses of :keyword:`try`
- statements are honored, and it is possible to intercept the exit attempt at
- an outer level.
+ Raise a :exc:`SystemExit` exception, signaling an intention to exit the interpreter.
The optional argument *arg* can be an integer giving the exit status
(defaulting to zero), or another type of object. If it is an integer, zero
@@ -432,7 +429,8 @@ always available.
Since :func:`exit` ultimately "only" raises an exception, it will only exit
the process when called from the main thread, and the exception is not
- intercepted.
+ intercepted. Cleanup actions specified by finally clauses of :keyword:`try` statements
+ are honored, and it is possible to intercept the exit attempt at an outer level.
.. versionchanged:: 3.6
If an error occurs in the cleanup after the Python interpreter
More information about the Python-checkins
mailing list