Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9fafc9f

Browse files
committed
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.
1 parent 8edd532 commit 9fafc9f

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

Doc/reference/compound_stmts.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -313,14 +313,14 @@ exception, the saved exception is set as the context of the new exception.
313313
If the :keyword:`finally` clause executes a :keyword:`return` or :keyword:`break`
314314
statement, the saved exception is discarded::
315315

316-
def f():
317-
try:
318-
1/0
319-
finally:
320-
return 42
321-
322-
>>> f()
323-
42
316+
>>> def f():
317+
... try:
318+
... 1/0
319+
... finally:
320+
... return 42
321+
...
322+
>>> f()
323+
42
324324

325325
The exception information is not available to the program during execution of
326326
the :keyword:`finally` clause.

0 commit comments

Comments
 (0)