summaryrefslogtreecommitdiffstats
path: root/Doc/lib
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2003-05-29 02:17:23 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2003-05-29 02:17:23 (GMT)
commit847207acffaf35e59601fea7d54f6db6f307e327 (patch)
treeaec3d56d69f4f3f82a300d27122fcdd00a75c0aa /Doc/lib
parentd3d5768e5ecf017d96b71d8ed437267ff47203b1 (diff)
downloadcpython-847207acffaf35e59601fea7d54f6db6f307e327.zip
cpython-847207acffaf35e59601fea7d54f6db6f307e327.tar.gz
cpython-847207acffaf35e59601fea7d54f6db6f307e327.tar.bz2
SF bug #719367, string exceptions are deprecated
Remove references to string based exceptions in the doc.
Diffstat (limited to 'Doc/lib')
-rw-r--r--Doc/lib/libexcs.tex13
-rw-r--r--Doc/lib/libsys.tex2
2 files changed, 10 insertions, 5 deletions
diff --git a/Doc/lib/libexcs.tex b/Doc/lib/libexcs.tex
index 5742fe5..1f39136 100644
--- a/Doc/lib/libexcs.tex
+++ b/Doc/lib/libexcs.tex
@@ -4,21 +4,26 @@
\modulesynopsis{Standard exception classes.}
-Exceptions can be class objects or string objects. Though most
-exceptions have been string objects in past versions of Python, in
-Python 1.5 and newer versions, all standard exceptions have been
-converted to class objects, and users are encouraged to do the same.
+Exceptions should be class objects.
The exceptions are defined in the module \module{exceptions}. This
module never needs to be imported explicitly: the exceptions are
provided in the built-in namespace as well as the \module{exceptions}
module.
+\begin{notice}
+In past versions of Python string exceptions were supported. In
+Python 1.5 and newer versions, all standard exceptions have been
+converted to class objects and users are encouraged to do the same.
+String exceptions will raise a \code{PendingDeprecationWarning}.
+In future versions, support for string exceptions will be removed.
+
Two distinct string objects with the same value are considered different
exceptions. This is done to force programmers to use exception names
rather than their string value when specifying exception handlers.
The string value of all built-in exceptions is their name, but this is
not a requirement for user-defined exceptions or exceptions defined by
library modules.
+\end{notice}
For class exceptions, in a \keyword{try}\stindex{try} statement with
an \keyword{except}\stindex{except} clause that mentions a particular
diff --git a/Doc/lib/libsys.tex b/Doc/lib/libsys.tex
index b8b781b..8a60cb2 100644
--- a/Doc/lib/libsys.tex
+++ b/Doc/lib/libsys.tex
@@ -91,7 +91,7 @@ It is always available.
containing three \code{None} values is returned. Otherwise, the
values returned are \code{(\var{type}, \var{value},
\var{traceback})}. Their meaning is: \var{type} gets the exception
- type of the exception being handled (a string or class object);
+ type of the exception being handled (a class object);
\var{value} gets the exception parameter (its \dfn{associated value}
or the second argument to \keyword{raise}, which is always a class
instance if the exception type is a class object); \var{traceback}