summaryrefslogtreecommitdiffstats
path: root/Doc/tutorial/errors.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-09-04 07:15:32 (GMT)
committerGeorg Brandl <georg@python.org>2007-09-04 07:15:32 (GMT)
commit6911e3ce3f72af759908b869b73391ea00d328e2 (patch)
tree5d4ff6070cb3f0f46f0a31ee4805b41053a06b48 /Doc/tutorial/errors.rst
parentc9879246a2dd33a217960496fdf4606cb117c6a6 (diff)
downloadcpython-6911e3ce3f72af759908b869b73391ea00d328e2.zip
cpython-6911e3ce3f72af759908b869b73391ea00d328e2.tar.gz
cpython-6911e3ce3f72af759908b869b73391ea00d328e2.tar.bz2
Convert all print statements in the docs.
Diffstat (limited to 'Doc/tutorial/errors.rst')
-rw-r--r--Doc/tutorial/errors.rst8
1 files changed, 4 insertions, 4 deletions
diff --git a/Doc/tutorial/errors.rst b/Doc/tutorial/errors.rst
index e3c631f..aa367e3 100644
--- a/Doc/tutorial/errors.rst
+++ b/Doc/tutorial/errors.rst
@@ -26,7 +26,7 @@ complaint you get while you are still learning Python::
The parser repeats the offending line and displays a little 'arrow' pointing at
the earliest point in the line where the error was detected. The error is
caused by (or at least detected at) the token *preceding* the arrow: in the
-example, the error is detected at the keyword :keyword:`print`, since a colon
+example, the error is detected at the function :func:`print`, since a colon
(``':'``) is missing before it. File name and line number are printed so you
know where to look in case the input came from a script.
@@ -181,8 +181,8 @@ desired. ::
... print(inst.args) # arguments stored in .args
... print(inst) # __str__ allows args to be printed directly
... x, y = inst # __getitem__ allows args to be unpacked directly
- ... print 'x =', x
- ... print 'y =', y
+ ... print('x =', x)
+ ... print('y =', y)
...
<type 'Exception'>
('spam', 'eggs')
@@ -260,7 +260,7 @@ directly or indirectly. For example::
>>> try:
... raise MyError(2*2)
... except MyError as e:
- ... print 'My exception occurred, value:', e.value
+ ... print('My exception occurred, value:', e.value)
...
My exception occurred, value: 4
>>> raise MyError, 'oops!'