FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-138045: Fix importing numpy in legacy subinterpreters by skipping switch to main interpreter when not needed by jan-hasse · Pull Request #142979 · python/cpython · GitHub

/ cpython Public

gh-138045: Fix importing numpy in legacy subinterpreters by skipping switch to main interpreter when not needed - #142979

Closed
jan-hasse wants to merge 1 commit into
python:mainfrom
jan-hasse:fix-issue-138045
Closed

gh-138045: Fix importing numpy in legacy subinterpreters by skipping switch to main interpreter when not needed#142979
jan-hasse wants to merge 1 commit into
python:mainfrom
jan-hasse:fix-issue-138045

Conversation

jan-hasse commented Dec 19, 2025
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown

(singlephase == NULL) check in update_global_state_for_extension could be removed because it's only called with pointers to stack objects.

I've tried creating a minimal working reproducer instead of importing numpy with the example from #138045 (comment) but didn't manage to integrate that into Python's test suite. Maybe someone else has more knowledge on how to create a simple test that reproduce the numpy situation.

The fix can be backported down to 3.13.

python-cla-bot Bot commented Dec 19, 2025
edited
Loading

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

bedevere-app Bot commented Dec 19, 2025

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

ZeroIntensity left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please add a news entry, and ideally a test case. This seems difficult to test, though. You could look into adding something to _testsinglephase.

brettcannon removed their request for review December 19, 2025 18:18
kumaraditya303 removed their request for review December 29, 2025 11:40
…pping switch to main interpreter when not needed

(singlephase == NULL) check in update_global_state_for_extension could be removed because it's only called with pointers to stack objects.

Copy link
Copy Markdown
Author

Added a news entry. I was not able to implement a test, I already looked at _testsinglephase but wasn't able to setup something similar to numpy :(

Copy link
Copy Markdown
Member

Thanks for the contribution. See my comment -- this was already fixed by #144602.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants


Back | FazBrowse Home | New Git URL