]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-67056: document that registering/unregistering an atexit func from within an atexi...
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>
Mon, 15 May 2023 08:12:52 +0000 (09:12 +0100)
committerGitHub <noreply@github.com>
Mon, 15 May 2023 08:12:52 +0000 (09:12 +0100)
Doc/library/atexit.rst
Misc/NEWS.d/next/Documentation/2023-05-14-12-11-28.gh-issue-67056.nVC2Rf.rst [new file with mode: 0644]

index f7f038107d11fe5807e0214b9c55fccd35246e9a..a2bd85b31c9a8dc765bf117ff8fa10228c7d2ed4 100644 (file)
@@ -20,6 +20,9 @@ at interpreter termination time they will be run in the order ``C``, ``B``,
 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 effect of registering or unregistering functions from within
+a cleanup function is undefined.
+
 .. versionchanged:: 3.7
     When used with C-API subinterpreters, registered functions
     are local to the interpreter they were registered in.
diff --git a/Misc/NEWS.d/next/Documentation/2023-05-14-12-11-28.gh-issue-67056.nVC2Rf.rst b/Misc/NEWS.d/next/Documentation/2023-05-14-12-11-28.gh-issue-67056.nVC2Rf.rst
new file mode 100644 (file)
index 0000000..2c6ef17
--- /dev/null
@@ -0,0 +1,2 @@
+Document that the effect of registering or unregistering an :mod:`atexit`
+cleanup function from within a registered cleanup function is undefined.