]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-112358: Fix Python 3.12 regression with subclassing struct.Struct (GH-11242...
authorMark Dickinson <dickinsm@gmail.com>
Mon, 27 Nov 2023 08:25:06 +0000 (08:25 +0000)
committerGitHub <noreply@github.com>
Mon, 27 Nov 2023 08:25:06 +0000 (08:25 +0000)
commit42df73652dba4937489e34a92dbf184a184c2d93
tree850ff04e3ed9ed107c12f290e3151d9911584c93
parentd7a788332666eabade922bf5d976df8c362ecb14
[3.12] gh-112358: Fix Python 3.12 regression with subclassing struct.Struct (GH-112424) (#112426)

* [3.12] gh-112358: Fix Python 3.12 regression with subclassing struct.Struct. (GH-112424)

Revert commit c8c0afc7137ab9f22bf59d591084948ca967c97c (PR GH-94532),
which moved `struct.Struct` initialisation from `Struct.__init__` to `Struct.__new__`.
This caused issues with code in the wild that subclasses `struct.Struct`..
(cherry picked from commit 9fe60340d7e8dc22b3aec205c557bc69a1b2d18c)

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
* Remove unrelated test
Lib/test/test_struct.py
Misc/NEWS.d/next/Library/2023-11-26-13-26-56.gh-issue-112358.smhaeZ.rst [new file with mode: 0644]
Modules/_struct.c
Modules/clinic/_struct.c.h