[3.6] bpo-28315: Improve code examples in docs (GH-1372) (#1445)
Replace
File "<stdin>", line 1, in ?
with
File "<stdin>", line 1, in <module>
(cherry picked from commit 8856940cf2e82cb17db2b684cd5732fe658605ca)
diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst
index e134d5d..073444c 100644
--- a/Doc/tutorial/classes.rst
+++ b/Doc/tutorial/classes.rst
@@ -784,7 +784,7 @@
'c'
>>> next(it)
Traceback (most recent call last):
- File "<stdin>", line 1, in ?
+ File "<stdin>", line 1, in <module>
next(it)
StopIteration
diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst
index 6a9bb48..54171bc 100644
--- a/Doc/tutorial/controlflow.rst
+++ b/Doc/tutorial/controlflow.rst
@@ -475,7 +475,7 @@
...
>>> function(0, a=0)
Traceback (most recent call last):
- File "<stdin>", line 1, in ?
+ File "<stdin>", line 1, in <module>
TypeError: function() got multiple values for keyword argument 'a'
When a final formal parameter of the form ``**name`` is present, it receives a
diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst
index 6140ece..1a73ac9 100644
--- a/Doc/tutorial/datastructures.rst
+++ b/Doc/tutorial/datastructures.rst
@@ -261,7 +261,7 @@
[(0, 0), (1, 1), (2, 4), (3, 9), (4, 16), (5, 25)]
>>> # the tuple must be parenthesized, otherwise an error is raised
>>> [x, x**2 for x in range(6)]
- File "<stdin>", line 1, in ?
+ File "<stdin>", line 1, in <module>
[x, x**2 for x in range(6)]
^
SyntaxError: invalid syntax
diff --git a/Doc/tutorial/inputoutput.rst b/Doc/tutorial/inputoutput.rst
index beeaac3..bad0302 100644
--- a/Doc/tutorial/inputoutput.rst
+++ b/Doc/tutorial/inputoutput.rst
@@ -362,7 +362,7 @@
>>> f.close()
>>> f.read()
Traceback (most recent call last):
- File "<stdin>", line 1, in ?
+ File "<stdin>", line 1, in <module>
ValueError: I/O operation on closed file
It is good practice to use the :keyword:`with` keyword when dealing with file