Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

BUG: Adjust numpy.i for SWIG 4.3 compatibility #27579

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

musicinmybrain
Copy link
Contributor

Replace each SWIG_Python_AppendOutput with SWIG_AppendOutput.

Fixes #27578.

See #27578 for context. From SWIG upstream:

2024-06-15: vadz
            [Python] #2907 Fix returning null from functions with output
            parameters.  Ensures OUTPUT and INOUT typemaps are handled
            consistently wrt return type.

            New declaration of SWIG_Python_AppendOutput is now:

              SWIG_Python_AppendOutput(PyObject* result, PyObject* obj, int is_void);

            The 3rd parameter is new and the new $isvoid special variable
            should be passed to it, indicating whether or not the wrapped
            function returns void.

            Also consider replacing with:

              SWIG_AppendOutput(PyObject* result, PyObject* obj);

            which calls SWIG_Python_AppendOutput with same parameters but adding $isvoid
            for final parameter.

	    *** POTENTIAL INCOMPATIBILITY ***

I don’t understand SWIG very well, so I’ve assumed that a blind search-and-replace of SWIG_Python_AppendOutput with SWIG_AppendOutput at least does not make anything worse! Review by someone more familiar with SWIG would be welcome.

See also related discussion on the Swig-devel mailing list.

Replace each `SWIG_Python_AppendOutput` with `SWIG_AppendOutput`.

Fixes numpy#27578.
musicinmybrain added a commit to musicinmybrain/cmake-build-extension that referenced this pull request Oct 16, 2024
@charris charris merged commit 5e0b16e into numpy:main Oct 16, 2024
68 checks passed
@charris
Copy link
Member

charris commented Oct 16, 2024

Looks like this should be backwards compatible with older swig versions. Let's give it a shot.

Thanks @musicinmybrain .

@charris charris added 09 - Backport-Candidate PRs tagged should be backported component: swig labels Oct 16, 2024
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Oct 18, 2024
diegoferigo pushed a commit to musicinmybrain/cmake-build-extension that referenced this pull request Oct 28, 2024
diegoferigo pushed a commit to musicinmybrain/cmake-build-extension that referenced this pull request Oct 28, 2024
diegoferigo pushed a commit to musicinmybrain/cmake-build-extension that referenced this pull request Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: SWIG tests are incompatible with SWIG 4.3
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.