]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.15] gh-76595: Add tests for PyCapsule_Import() (GH-154588) (GH-154619)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 24 Jul 2026 15:31:45 +0000 (17:31 +0200)
committerGitHub <noreply@github.com>
Fri, 24 Jul 2026 15:31:45 +0000 (15:31 +0000)
commitb6f24be08d02a1f1b505a0f227221e48e86ead42
tree9752e8e6f6d333f29fd45e9b0c8540b1964ebae5
parentf921edf0f1494af3d5a474b554b451fb6a576996
[3.15] gh-76595: Add tests for PyCapsule_Import() (GH-154588) (GH-154619)

Add _testcapi helpers to create a capsule with an arbitrary name and to call PyCapsule_Import(), and Python tests covering the current behavior: only the first component of the dotted name is imported, the rest are attribute lookups.
(cherry picked from commit d24d9d0f1d1177cd6f130a4bd59c1c267a0f8d1f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Lib/test/test_capi/test_capsule.py [new file with mode: 0644]
Misc/NEWS.d/next/Tests/2026-07-24-12-00-00.gh-issue-76595.KfF5xR.rst [new file with mode: 0644]
Modules/Setup.stdlib.in
Modules/_testlimitedcapi.c
Modules/_testlimitedcapi/capsule.c [new file with mode: 0644]
Modules/_testlimitedcapi/parts.h
PCbuild/_testlimitedcapi.vcxproj
PCbuild/_testlimitedcapi.vcxproj.filters