From: Éric Araujo Date: Fri, 29 Jul 2011 16:04:24 +0000 (+0200) Subject: Document that atexit execution order is undefined (#9788) X-Git-Tag: v3.2.2rc1~52 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fe1e298d8bbfbdfd1c2af74dbb74f47e2d04a6d0;p=python Document that atexit execution order is undefined (#9788) --- diff --git a/Doc/library/atexit.rst b/Doc/library/atexit.rst index cc1051bf74..5b87b94ca1 100644 --- a/Doc/library/atexit.rst +++ b/Doc/library/atexit.rst @@ -9,7 +9,9 @@ The :mod:`atexit` module defines functions to register and unregister cleanup functions. Functions thus registered are automatically executed upon normal -interpreter termination. +interpreter termination. The order in which the functions are called is not +defined; if you have cleanup operations that depend on each other, you should +wrap them in a function and register that one. This keeps :mod:`atexit` simple. Note: the functions registered via this module are not called when the program is killed by a signal not handled by Python, when a Python fatal internal error