mirror of
https://github.com/python/cpython.git
synced 2025-07-31 07:04:42 +00:00
Add prompts to interactive example.
This makes it match the new example below, and allows Sphinx's "hide the prompts and output" feature to work.
This commit is contained in:
parent
8edd532026
commit
9fafc9f79a
1 changed files with 8 additions and 8 deletions
|
@ -313,14 +313,14 @@ exception, the saved exception is set as the context of the new exception.
|
||||||
If the :keyword:`finally` clause executes a :keyword:`return` or :keyword:`break`
|
If the :keyword:`finally` clause executes a :keyword:`return` or :keyword:`break`
|
||||||
statement, the saved exception is discarded::
|
statement, the saved exception is discarded::
|
||||||
|
|
||||||
def f():
|
>>> def f():
|
||||||
try:
|
... try:
|
||||||
1/0
|
... 1/0
|
||||||
finally:
|
... finally:
|
||||||
return 42
|
... return 42
|
||||||
|
...
|
||||||
>>> f()
|
>>> f()
|
||||||
42
|
42
|
||||||
|
|
||||||
The exception information is not available to the program during execution of
|
The exception information is not available to the program during execution of
|
||||||
the :keyword:`finally` clause.
|
the :keyword:`finally` clause.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue