cpython: 84d74eb7a341 (original) (raw)

Mercurial > cpython

changeset 85294:84d74eb7a341 2.7

Issue #15233: Python now guarantees that callables registered with the atexit module will be called in a deterministic order. [#15233]

Charles-François Natali cf.natali@gmail.com
date Wed, 21 Aug 2013 18:25:00 +0200
parents cb9c780a7c1a
children ee0bb673536c
files Doc/library/atexit.rst Misc/NEWS
diffstat 2 files changed, 10 insertions(+), 6 deletions(-)[+] [-] Doc/library/atexit.rst 13 Misc/NEWS 3

line wrap: on

line diff

--- a/Doc/library/atexit.rst +++ b/Doc/library/atexit.rst @@ -15,13 +15,14 @@ The :mod:atexit module defines a single function to register cleanup functions. Functions thus registered are automatically executed upon normal -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. +interpreter termination. :mod:atexit runs these functions in the reverse +order in which they were registered; if you register A, B, and C, +at interpreter termination time they will be run in the order C, B, +A. -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 -is detected, or when :func:os._exit is called. +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 is detected, or when :func:os._exit is called. .. index:: single: exitfunc (in sys)

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -32,6 +32,9 @@ Core and Builtins Library ------- +- Issue #15233: Python now guarantees that callables registered with the atexit