Skip to content

Commit 10117f1

Browse files
authored
bpo-6634: [doc] clarify that sys.exit() does not always exit the interpreter (GH-31639)
1 parent 88567a9 commit 10117f1

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Doc/library/sys.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -449,10 +449,7 @@ always available.
449449

450450
.. function:: exit([arg])
451451

452-
Exit from Python. This is implemented by raising the :exc:`SystemExit`
453-
exception, so cleanup actions specified by finally clauses of :keyword:`try`
454-
statements are honored, and it is possible to intercept the exit attempt at
455-
an outer level.
452+
Raise a :exc:`SystemExit` exception, signaling an intention to exit the interpreter.
456453

457454
The optional argument *arg* can be an integer giving the exit status
458455
(defaulting to zero), or another type of object. If it is an integer, zero
@@ -469,7 +466,8 @@ always available.
469466

470467
Since :func:`exit` ultimately "only" raises an exception, it will only exit
471468
the process when called from the main thread, and the exception is not
472-
intercepted.
469+
intercepted. Cleanup actions specified by finally clauses of :keyword:`try` statements
470+
are honored, and it is possible to intercept the exit attempt at an outer level.
473471

474472
.. versionchanged:: 3.6
475473
If an error occurs in the cleanup after the Python interpreter

0 commit comments

Comments
 (0)