Mercurial > cpython-lru_cache-weakref
diff Doc/lib/libsys.tex @ 17176:596efa7e7df8 legacy-trunk
Give a slightly better explanation of excepthook.
| author | Ka-Ping Yee <ping@zesty.ca> |
|---|---|
| date | Fri, 23 Mar 2001 05:17:41 +0000 |
| parents | b44e77a12978 |
| children | 35e3f2418b2d 064de84385ca |
line wrap: on
line diff
--- a/Doc/lib/libsys.tex Fri Mar 23 05:14:10 2001 +0000 +++ b/Doc/lib/libsys.tex Fri Mar 23 05:17:41 2001 +0000 @@ -51,19 +51,21 @@ \code{sys.displayhook} is called on the result of evaluating an expression entered in an interactive Python session. The display of these values can be customized by assigning -another function to \code{sys.displayhook}. +another one-argument function to \code{sys.displayhook}. \end{funcdesc} \begin{funcdesc}{excepthook}{\var{type}, \var{value}, \var{traceback}} This function prints out a given traceback and exception to \code{sys.stderr}. -\code{sys.excepthook} is called when an exception is raised -and uncaught. In an interactive session this happens just before +When an exception is raised and uncaught, the interpreter calls +\code{sys.excepthook} with three arguments, the exception class, +exception instance, and a traceback object. +In an interactive session this happens just before control is returned to the prompt; in a Python program this happens just before the program exits. The handling of such top-level exceptions can be customized by -assigning another function to \code{sys.excepthook}. +assigning another three-argument function to \code{sys.excepthook}. \end{funcdesc} \begin{datadesc}{__displayhook__}
