]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-6634: [doc] clarify that sys.exit() does not always exit the interpreter (GH...
authorvidhya <96202776+Vidhyavinu@users.noreply.github.com>
Thu, 3 Mar 2022 14:23:47 +0000 (09:23 -0500)
committerGitHub <noreply@github.com>
Thu, 3 Mar 2022 14:23:47 +0000 (14:23 +0000)
Doc/library/sys.rst

index 5e47201f88eae130b18d7c8753383ae4dfb860c6..b83b1167e8aad57f20b5c8bd298e31ecde154ea2 100644 (file)
@@ -449,10 +449,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
@@ -469,7 +466,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