diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-03-03 14:49:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-03 14:49:22 (GMT) |
commit | 9d9dc59d07d51d73e5af7dd506d0da63aa336995 (patch) | |
tree | aa58cfabc98ed0fa520e62e341d39647ca482c59 | |
parent | fa8c5ed9c80507670c756aa83ea872b8a92bcd1c (diff) | |
download | cpython-9d9dc59d07d51d73e5af7dd506d0da63aa336995.zip cpython-9d9dc59d07d51d73e5af7dd506d0da63aa336995.tar.gz cpython-9d9dc59d07d51d73e5af7dd506d0da63aa336995.tar.bz2 |
bpo-6634: [doc] clarify that sys.exit() does not always exit the interpreter (GH-31639)
(cherry picked from commit 10117f1d8cb49ce95493555c06050faf636ccee7)
Co-authored-by: vidhya <96202776+Vidhyavinu@users.noreply.github.com>
-rw-r--r-- | Doc/library/sys.rst | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 29cb54b..b59fa2c 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -429,10 +429,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 @@ -449,7 +446,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 |