]> granicus.if.org Git - python/commitdiff
Add prompts to interactive example.
authorZachary Ware <zachary.ware@gmail.com>
Tue, 6 May 2014 14:18:17 +0000 (09:18 -0500)
committerZachary Ware <zachary.ware@gmail.com>
Tue, 6 May 2014 14:18:17 +0000 (09:18 -0500)
This makes it match the new example below, and allows Sphinx's
"hide the prompts and output" feature to work.

Doc/reference/compound_stmts.rst

index 53718615fd8b4a0e18877721b2d305d5efcfd19e..08230fa498d2d410d2fd4a42578b2d45ced1df5e 100644 (file)
@@ -296,14 +296,14 @@ is executed.  If there is a saved exception, it is re-raised at the end of the
 exception or executes a :keyword:`return` or :keyword:`break` statement, the
 saved exception is discarded::
 
-    def f():
-        try:
-            1/0
-        finally:
-            return 42
-
-    >>> f()
-    42
+   >>> def f():
+   ...     try:
+   ...         1/0
+   ...     finally:
+   ...         return 42
+   ...
+   >>> f()
+   42
 
 The exception information is not available to the program during execution of
 the :keyword:`finally` clause.