Skip to content

Support Py_NewRef calls on Python 3.9 - #267

Closed
sricharanreddycheruku wants to merge 1 commit into
darvid:mainfrom
sricharanreddycheruku:fix-python39-reference-compatibility
Closed

sricharanreddycheruku wants to merge 1 commit into
darvid:mainfrom
sricharanreddycheruku:fix-python39-reference-compatibility

Conversation

@sricharanreddycheruku

Copy link
Copy Markdown

The extension calls Py_NewRef, introduced in Python 3.10, but declares
Python >=3.9 support. A normal source-wheel build on Python 3.9 fails with
implicit-declaration and invalid-return-type errors.

Add an eight-line guarded equivalent using Py_INCREF on Python <3.10.
Newer interpreters retain CPython's implementation. Public API and package
requirements stay the same; this does not add release-pipeline wheels.

Original source fails to build on Python 3.9.25; fixed source builds and passes
31 tests under PYTHONMALLOC=debug, with two slow skips and one existing UTF-8
compiler skip. Python 3.12.14 also passes 31 tests with the same skips.
Combined with #265/#266 and the prepared scratch-allocation patch: 96 tests
pass on Python 3.9 with only two slow skips. All patches apply cleanly.
clang-format 9 and diff checks pass. Independent branch from main.
Client integration of the pending Pathspec fixes also passes 250 tests and
1,156 subtests (one skip) on Python 3.9 with all three backends enabled;
RE2 uses its last Python 3.9 wheel, 1.1.20250805.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant