[Python-checkins] cpython (3.5): Issue #28815: Change '?' to '<module>' in some doc examples.
terry.reedy
python-checkins at python.org
Fri Sep 30 15:39:45 EDT 2016
https://hg.python.org/cpython/rev/1bead1f0260f
changeset: 104188:1bead1f0260f
branch: 3.5
parent: 104184:53a578f51f21
user: Terry Jan Reedy <tjreedy at udel.edu>
date: Fri Sep 30 15:38:48 2016 -0400
summary:
Issue #28815: Change '?' to '<module>' in some doc examples.
Patch by Mariatta Wijaya.
files:
Doc/tutorial/errors.rst | 16 ++++++++--------
Misc/ACKS | 1 +
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/Doc/tutorial/errors.rst b/Doc/tutorial/errors.rst
--- a/Doc/tutorial/errors.rst
+++ b/Doc/tutorial/errors.rst
@@ -18,7 +18,7 @@
complaint you get while you are still learning Python::
>>> while True print('Hello world')
- File "<stdin>", line 1, in ?
+ File "<stdin>", line 1
while True print('Hello world')
^
SyntaxError: invalid syntax
@@ -44,15 +44,15 @@
>>> 10 * (1/0)
Traceback (most recent call last):
- File "<stdin>", line 1, in ?
+ File "<stdin>", line 1, in <module>
ZeroDivisionError: division by zero
>>> 4 + spam*3
Traceback (most recent call last):
- File "<stdin>", line 1, in ?
+ File "<stdin>", line 1, in <module>
NameError: name 'spam' is not defined
>>> '2' + 2
Traceback (most recent call last):
- File "<stdin>", line 1, in ?
+ File "<stdin>", line 1, in <module>
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 "<stdin>", line 1, in ?
+ File "<stdin>", line 1, in <module>
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 "<stdin>", line 2, in ?
+ File "<stdin>", line 2, in <module>
NameError: HiThere
@@ -308,7 +308,7 @@
...
Goodbye, world!
Traceback (most recent call last):
- File "<stdin>", line 2, in ?
+ File "<stdin>", line 2, in <module>
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 "<stdin>", line 1, in ?
+ File "<stdin>", line 1, in <module>
File "<stdin>", line 3, in divide
TypeError: unsupported operand type(s) for /: 'str' and 'str'
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1595,6 +1595,7 @@
Felix Wiemann
Gerry Wiener
Frank Wierzbicki
+Mariatta Wijaya
Santoso Wijaya
Chris Wilcox
Bryce "Zooko" Wilcox-O'Hearn
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list