]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-76595: Add tests for PyCapsule_Import() (GH-154588) (GH-154620)
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 24 Jul 2026 15:34:10 +0000 (18:34 +0300)
committerGitHub <noreply@github.com>
Fri, 24 Jul 2026 15:34:10 +0000 (15:34 +0000)
commitffa3ba98d922765f8e3990f327662f1d4254e6bd
tree329dbaab7564ddc7fbee4e238e9b2567d662a535
parent2cb04b90290df2c6a6fce4fdeb8e94f434e3a90c
[3.14] gh-76595: Add tests for PyCapsule_Import() (GH-154588) (GH-154620)

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: 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