From: Terry Jan Reedy Date: Fri, 30 Sep 2016 19:38:41 +0000 (-0400) Subject: Issue #28815: Change '?' to '' in some doc examples. X-Git-Tag: v2.7.13rc1~98 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dace77c5306fc68ec754b3c73cdba29bfa10444f;p=python Issue #28815: Change '?' to '' in some doc examples. Patch by Mariatta Wijaya. --- diff --git a/Doc/tutorial/errors.rst b/Doc/tutorial/errors.rst index 9787e6b439..466009e51e 100644 --- a/Doc/tutorial/errors.rst +++ b/Doc/tutorial/errors.rst @@ -18,7 +18,7 @@ Syntax errors, also known as parsing errors, are perhaps the most common kind of 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 @@ programs, however, and result in error messages as shown here:: >>> 10 * (1/0) Traceback (most recent call last): - File "", line 1, in ? + File "", line 1, in ZeroDivisionError: integer division or modulo 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: cannot concatenate 'str' and 'int' objects The last line of the error message indicates what happened. Exceptions come in @@ -223,7 +223,7 @@ exception to occur. For example:: >>> 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. @@ -242,7 +242,7 @@ re-raise the exception:: ... An exception flew by! Traceback (most recent call last): - File "", line 2, in ? + File "", line 2, in NameError: HiThere @@ -270,7 +270,7 @@ example:: My exception occurred, value: 4 >>> raise MyError('oops!') Traceback (most recent call last): - File "", line 1, in ? + File "", line 1, in __main__.MyError: 'oops!' In this example, the default :meth:`__init__` of :class:`Exception` has been @@ -339,7 +339,7 @@ example:: ... 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` @@ -372,7 +372,7 @@ the same :keyword:`try` statement works as of Python 2.5):: >>> 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' diff --git a/Misc/ACKS b/Misc/ACKS index ffed3109c6..2f5688861a 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1494,6 +1494,7 @@ Truida Wiedijk Felix Wiemann Gerry Wiener Frank Wierzbicki +Mariatta Wijaya Santoso Wijaya Bryce "Zooko" Wilcox-O'Hearn Timothy Wild