Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d22ff49b
Commit
d22ff49b
authored
Sep 30, 2016
by
Terry Jan Reedy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #28815: Change '?' to '<module>' in some doc examples.
Patch by Mariatta Wijaya.
parent
9174fcee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
Doc/tutorial/errors.rst
Doc/tutorial/errors.rst
+8
-8
Misc/ACKS
Misc/ACKS
+1
-0
No files found.
Doc/tutorial/errors.rst
View file @
d22ff49b
...
...
@@ -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 "<stdin>", line 1
, in ?
File "<stdin>", 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 "<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 @@ exception to occur. For example::
>>> 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 @@ re-raise the exception::
...
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 @@ example::
...
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 @@ complicated example::
>>> 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'
...
...
Misc/ACKS
View file @
d22ff49b
...
...
@@ -1595,6 +1595,7 @@ Truida Wiedijk
Felix Wiemann
Gerry Wiener
Frank Wierzbicki
Mariatta Wijaya
Santoso Wijaya
Chris Wilcox
Bryce "Zooko" Wilcox-O'Hearn
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment