]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-104533: Fix `@ctypes.util.struct` with string annotations (#154040)
authorVictor Stinner <vstinner@python.org>
Sun, 19 Jul 2026 10:05:22 +0000 (12:05 +0200)
committerGitHub <noreply@github.com>
Sun, 19 Jul 2026 10:05:22 +0000 (12:05 +0200)
commit83674483563c83550c87311adb557f8565916ce0
tree55ae516e34b53efa20fa0372a44496be536290ab
parentd5eb31209699ef59857780a5530191031ee3f796
gh-104533: Fix `@ctypes.util.struct` with string annotations (#154040)

Fix `@ctypes.util.struct` on structures declared in a module which uses
`from __future__ import annotations`. The decorator now calls
get_annotations() with eval_str=True.
Lib/ctypes/util.py
Lib/test/test_ctypes/struct_str_ann.py [new file with mode: 0644]
Lib/test/test_ctypes/test_structures.py