diff -r 6619b76053a5 Doc/tutorial/errors.rst --- a/Doc/tutorial/errors.rst Thu Sep 29 22:31:28 2016 +0200 +++ b/Doc/tutorial/errors.rst Thu Sep 29 19:52:42 2016 -0700 @@ -18,7 +18,7 @@ complaint you get while you are still learning Python:: >>> while True print('Hello world') - File "", line 1, in ? + File "", line 1 while True print('Hello world') ^ SyntaxError: invalid syntax @@ -44,15 +44,15 @@ >>> 10 * (1/0) Traceback (most recent call last): - File "", line 1, in ? + File "", line 1, in ZeroDivisionError: division by zero >>> 4 + spam*3 Traceback (most recent call last): - File "", line 1, in ? + File "", line 1, in NameError: name 'spam' is not defined >>> '2' + 2 Traceback (most recent call last): - File "", line 1, in ? + File "", line 1, in TypeError: Can't convert 'int' object to str implicitly The last line of the error message indicates what happened. Exceptions come in @@ -214,7 +214,7 @@ >>> raise NameError('HiThere') Traceback (most recent call last): - File "", line 1, in ? + File "", line 1, in NameError: HiThere The sole argument to :keyword:`raise` indicates the exception to be raised. @@ -233,7 +233,7 @@ ... An exception flew by! Traceback (most recent call last): - File "", line 2, in ? + File "", line 2, in NameError: HiThere @@ -308,7 +308,7 @@ ... Goodbye, world! Traceback (most recent call last): - File "", line 2, in ? + File "", line 2, in KeyboardInterrupt A *finally clause* is always executed before leaving the :keyword:`try` @@ -340,7 +340,7 @@ >>> divide("2", "1") executing finally clause Traceback (most recent call last): - File "", line 1, in ? + File "", line 1, in File "", line 3, in divide TypeError: unsupported operand type(s) for /: 'str' and 'str'