]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.8] [3.9] bpo-41654: Fix deallocator of MemoryError to account for subclasses ...
authorPablo Galindo <Pablogsal@gmail.com>
Tue, 1 Sep 2020 20:40:48 +0000 (21:40 +0100)
committerGitHub <noreply@github.com>
Tue, 1 Sep 2020 20:40:48 +0000 (21:40 +0100)
commit77f4000ae0d43a2685face80e7f14d4aba053973
tree1d49556219c04d147c74ccbe6eb3937b8d893363
parent38e32872eb3cf0dc9dd8cef9b05e47ba03638d34
[3.8] [3.9] bpo-41654: Fix deallocator of MemoryError to account for subclasses (GH-22020) (GH-22046)

When allocating MemoryError classes, there is some logic to use
pre-allocated instances in a freelist only if the type that is being
allocated is not a subclass of MemoryError. Unfortunately in the
destructor this logic is not present so the freelist is altered even
with subclasses of MemoryError..
(cherry picked from commit 9b648a95ccb4c3b14f1e87158f5c9f5dbb2f62c0)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>.
(cherry picked from commit 87e91ae2e5f81e096c32839f211c68a749a4435a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Lib/test/test_exceptions.py
Misc/NEWS.d/next/Core and Builtins/2020-08-30-20-38-33.bpo-41654.HtnhAM.rst [new file with mode: 0644]
Objects/exceptions.c