@@ -49,9 +49,7 @@ \section{Built-in Exceptions}
4949\setindexsubitem {(built-in exception base class)}
5050
5151The following exceptions are only used as base classes for other
52- exceptions. When string-based standard exceptions are used, they
53- are tuples containing the directly derived classes.
54- \strong {Note:} These will always be classes in Python 1.6.
52+ exceptions.
5553
5654\begin {excdesc }{Exception}
5755The root class for exceptions. All built-in exceptions are derived
@@ -191,7 +189,7 @@ \section{Built-in Exceptions}
191189 still be rescued (by deleting some objects). The associated value is
192190 a string indicating what kind of (internal) operation ran out of memory.
193191 Note that because of the underlying memory management architecture
194- (\C {} 's \cfunction {malloc()} function), the interpreter may not
192+ (C 's \cfunction {malloc()} function), the interpreter may not
195193 always be able to completely recover from this situation; it
196194 nevertheless raises an exception so that a stack traceback can be
197195 printed, in case a run-away program was the cause.
@@ -224,7 +222,7 @@ \section{Built-in Exceptions}
224222 Raised when the result of an arithmetic operation is too large to be
225223 represented. This cannot occur for long integers (which would rather
226224 raise \exception {MemoryError} than give up). Because of the lack of
227- standardization of floating point exception handling in \C {} , most
225+ standardization of floating point exception handling in C , most
228226 floating point operations also aren't checked. For plain integers,
229227 all operations that can overflow are checked except left shift, where
230228 typical applications prefer to drop bits than raise an exception.
@@ -273,16 +271,15 @@ \section{Built-in Exceptions}
273271 This exception is raised by the \function {sys.exit()} function. When it
274272 is not handled, the Python interpreter exits; no stack traceback is
275273 printed. If the associated value is a plain integer, it specifies the
276- system exit status (passed to \C {} 's \cfunction {exit()} function); if it is
274+ system exit status (passed to C 's \cfunction {exit()} function); if it is
277275 \code {None}, the exit status is zero; if it has another type (such as
278276 a string), the object's value is printed and the exit status is one.
279277
280- When class exceptions are used, the instance has an attribute
281- \member {code} which is set to the proposed exit status or error message
282- (defaulting to \code {None}). Also, this exception derives directly
283- from \exception {Exception} and not \exception {StandardError}, since it
284- is not technically an error.
285-
278+ Instances have an attribute \member {code} which is set to the
279+ proposed exit status or error message (defaulting to \code {None}).
280+ Also, this exception derives directly from \exception {Exception} and
281+ not \exception {StandardError}, since it is not technically an error.
282+
286283 A call to \function {sys.exit()} is translated into an exception so that
287284 clean-up handlers (\keyword {finally} clauses of \keyword {try} statements)
288285 can be executed, and so that a debugger can execute a script without
@@ -297,9 +294,17 @@ \section{Built-in Exceptions}
297294 details about the type mismatch.
298295\end {excdesc }
299296
297+ \begin {excdesc }{UnboundLocalError}
298+ Raised when a reference is made to a local variable in a function or
299+ method, but no value has been bound to that variable. This is a
300+ subclass of \exception {NameError}.
301+ \versionadded {1.6}
302+ \end {excdesc }
303+
300304\begin {excdesc }{UnicodeError}
301305 Raised when a Unicode-related encoding or decoding error occurs. It
302306 is a subclass of \exception {ValueError}.
307+ \versionadded {1.6}
303308\end {excdesc }
304309
305310\begin {excdesc }{ValueError}
0 commit comments