summaryrefslogtreecommitdiffstats
path: root/Doc/ref/ref7.tex
diff options
context:
space:
mode:
authorMichael W. Hudson <mwh@python.net>2005-03-04 14:33:32 (GMT)
committerMichael W. Hudson <mwh@python.net>2005-03-04 14:33:32 (GMT)
commita2a9888f22a7811938d2f708344e01dfc000841c (patch)
treea42cfe774d57c4ba8c87734b27979be32a437edb /Doc/ref/ref7.tex
parentc72dd38f30eb034f33e5efa1029ed17ca773d267 (diff)
downloadcpython-a2a9888f22a7811938d2f708344e01dfc000841c.zip
cpython-a2a9888f22a7811938d2f708344e01dfc000841c.tar.gz
cpython-a2a9888f22a7811938d2f708344e01dfc000841c.tar.bz2
Updates to the exceptions documentation (this is my patch #1156102).
Diffstat (limited to 'Doc/ref/ref7.tex')
-rw-r--r--Doc/ref/ref7.tex26
1 files changed, 13 insertions, 13 deletions
diff --git a/Doc/ref/ref7.tex b/Doc/ref/ref7.tex
index 5e50a74..7459412 100644
--- a/Doc/ref/ref7.tex
+++ b/Doc/ref/ref7.tex
@@ -223,11 +223,11 @@ clause, if present, must be last; it matches any exception. For an
except clause with an expression, that expression is evaluated, and the
clause matches the exception if the resulting object is ``compatible''
with the exception. An object is compatible with an exception if it
-is either the object that identifies the exception, or (for exceptions
-that are classes) it is a base class of the exception, or it is a
-tuple containing an item that is compatible with the exception. Note
-that the object identities must match, i.e. it must be the same
-object, not just an object with the same value.
+is the class or a base class of the exception object, a tuple
+containing an item compatible with the exception, or, in the
+(deprecated) case of string exceptions, is the raised string itself
+(note that the object identities must match, i.e. it must be the same
+string object, not just a string with the same value).
\kwindex{except}
If no except clause matches the exception, the search for an exception
@@ -239,14 +239,14 @@ and a search starts for the new exception in the surrounding code and
on the call stack (it is treated as if the entire \keyword{try} statement
raised the exception).
-When a matching except clause is found, the exception's parameter is
-assigned to the target specified in that except clause, if present,
-and the except clause's suite is executed. All except clauses must
-have an executable block. When the end of this block
-is reached, execution continues normally after the entire try
-statement. (This means that if two nested handlers exist for the same
-exception, and the exception occurs in the try clause of the inner
-handler, the outer handler will not handle the exception.)
+When a matching except clause is found, the exception is assigned to
+the target specified in that except clause, if present, and the except
+clause's suite is executed. All except clauses must have an
+executable block. When the end of this block is reached, execution
+continues normally after the entire try statement. (This means that
+if two nested handlers exist for the same exception, and the exception
+occurs in the try clause of the inner handler, the outer handler will
+not handle the exception.)
Before an except clause's suite is executed, details about the
exception are assigned to three variables in the