From fe1e298d8bbfbdfd1c2af74dbb74f47e2d04a6d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Fri, 29 Jul 2011 18:04:24 +0200 Subject: [PATCH] Document that atexit execution order is undefined (#9788) --- Doc/library/atexit.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Doc/library/atexit.rst b/Doc/library/atexit.rst index cc1051bf74f..5b87b94ca15 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