From 48310cd3f2e02ced9ae836ccbcb67e9af3097d62 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 3 Jan 2009 21:18:54 +0000 Subject: Remove trailing whitespace. --- Doc/tutorial/errors.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Doc/tutorial/errors.rst') diff --git a/Doc/tutorial/errors.rst b/Doc/tutorial/errors.rst index ca70f898bc..e78947cb68 100644 --- a/Doc/tutorial/errors.rst +++ b/Doc/tutorial/errors.rst @@ -91,7 +91,7 @@ is signalled by raising the :exc:`KeyboardInterrupt` exception. :: ... break ... except ValueError: ... print("Oops! That was no valid number. Try again...") - ... + ... The :keyword:`try` statement works as follows. @@ -195,12 +195,12 @@ indirectly) in the try clause. For example:: >>> def this_fails(): ... x = 1/0 - ... + ... >>> try: ... this_fails() ... except ZeroDivisionError as err: ... print('Handling run-time error:', err) - ... + ... Handling run-time error: int division or modulo by zero @@ -251,12 +251,12 @@ directly or indirectly. For example:: ... self.value = value ... def __str__(self): ... return repr(self.value) - ... + ... >>> try: ... raise MyError(2*2) ... except MyError as e: ... print('My exception occurred, value:', e.value) - ... + ... My exception occurred, value: 4 >>> raise MyError('oops!') Traceback (most recent call last): @@ -326,7 +326,7 @@ example:: ... raise KeyboardInterrupt ... finally: ... print('Goodbye, world!') - ... + ... Goodbye, world! Traceback (most recent call last): File "", line 2, in ? @@ -389,9 +389,9 @@ and print its contents to the screen. :: print(line) The problem with this code is that it leaves the file open for an indeterminate -amount of time after this part of the code has finished executing. -This is not an issue in simple scripts, but can be a problem for larger -applications. The :keyword:`with` statement allows objects like files to be +amount of time after this part of the code has finished executing. +This is not an issue in simple scripts, but can be a problem for larger +applications. The :keyword:`with` statement allows objects like files to be used in a way that ensures they are always cleaned up promptly and correctly. :: with open("myfile.txt") as f: -- cgit v1.2.1