Fix bug 1052242.  Also includes rewrite of test case using unittest and
avoiding use of popen.
diff --git a/Doc/lib/libatexit.tex b/Doc/lib/libatexit.tex
index c9775d1..922f5d4 100644
--- a/Doc/lib/libatexit.tex
+++ b/Doc/lib/libatexit.tex
@@ -39,6 +39,12 @@
 order.  The assumption is that lower level modules will normally be
 imported before higher level modules and thus must be cleaned up
 later.
+
+If an exception is raised during execution of the exit handlers, a traceback
+is printed (unless SystemExit is raised) and the exception information is
+saved.  After all exit handlers have had a chance to run the last exception
+to be raised is reraised.
+
 \end{funcdesc}