summaryrefslogtreecommitdiffstats
path: root/Doc/tutorial
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/tutorial')
-rw-r--r--Doc/tutorial/errors.rst6
-rw-r--r--Doc/tutorial/introduction.rst4
2 files changed, 5 insertions, 5 deletions
diff --git a/Doc/tutorial/errors.rst b/Doc/tutorial/errors.rst
index e1d988c..ebec952 100644
--- a/Doc/tutorial/errors.rst
+++ b/Doc/tutorial/errors.rst
@@ -216,7 +216,7 @@ Raising Exceptions
The :keyword:`raise` statement allows the programmer to force a specified
exception to occur. For example::
- >>> raise NameError, 'HiThere'
+ >>> raise NameError('HiThere')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: HiThere
@@ -231,7 +231,7 @@ handle it, a simpler form of the :keyword:`raise` statement allows you to
re-raise the exception::
>>> try:
- ... raise NameError, 'HiThere'
+ ... raise NameError('HiThere')
... except NameError:
... print 'An exception flew by!'
... raise
@@ -263,7 +263,7 @@ directly or indirectly. For example::
... print 'My exception occurred, value:', e.value
...
My exception occurred, value: 4
- >>> raise MyError, 'oops!'
+ >>> raise MyError('oops!')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
__main__.MyError: 'oops!'
diff --git a/Doc/tutorial/introduction.rst b/Doc/tutorial/introduction.rst
index 21d3627..23ff522 100644
--- a/Doc/tutorial/introduction.rst
+++ b/Doc/tutorial/introduction.rst
@@ -285,11 +285,11 @@ position in the string results in an error::
>>> word[0] = 'x'
Traceback (most recent call last):
File "<stdin>", line 1, in ?
- TypeError: object doesn't support item assignment
+ TypeError: object does not support item assignment
>>> word[:1] = 'Splat'
Traceback (most recent call last):
File "<stdin>", line 1, in ?
- TypeError: object doesn't support slice assignment
+ TypeError: object does not support slice assignment
However, creating a new string with the combined content is easy and efficient::