bpo-46328: Add sys.exception() (GH-30514)

This commit is contained in:
Irit Katriel 2022-01-13 12:35:58 +00:00 committed by GitHub
parent 9c2ebb906d
commit c590b581bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 147 additions and 19 deletions

View file

@ -167,7 +167,7 @@ then re-raise the exception (allowing a caller to handle the exception as well):
raise
Alternatively the last except clause may omit the exception name(s), however the exception
value must then be retrieved from ``sys.exc_info()[1]``.
value must then be retrieved with ``sys.exception()``.
The :keyword:`try` ... :keyword:`except` statement has an optional *else
clause*, which, when present, must follow all *except clauses*. It is useful