GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-28411: Isolate PyInterpreterState.modules by ericsnowcurrently · Pull Request #3575 · python/cpython

Conversation

@ericsnowcurrently

@ericsnowcurrently ericsnowcurrently commented Sep 14, 2017 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

A bunch of code currently uses PyInterpreterState.modules directly instead of PyImport_GetModuleDict(). This complicates efforts to make changes relative to sys.modules. This patch switches to using PyImport_GetModuleDict() uniformly. Also, a number of related uses of sys.modules are updated for uniformity for the same reason.

Note that this code was already reviewed and merged as part of #1638. I reverted that and am now splitting it up into more focused parts.

https://bugs.python.org/issue28411

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
ericsnowcurrently added 4 commits September 14, 2017 07:21
@ericsnowcurrently
Add _PyImport_GetModuleDict().
2ff5d7c
@ericsnowcurrently
Import the sys module before any other imports.
79a8461
@ericsnowcurrently
Pass the modules dict to _PyImport_FindBuiltin().
6f96d3a
@ericsnowcurrently
Replace usage of interp->modules with PyImport_GetModuleDict().
ad8c082
@ericsnowcurrently
ericsnowcurrently requested a review from a team September 14, 2017 15:25
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Sep 14, 2017
@bedevere-bot bedevere-bot added the awaiting merge label Sep 14, 2017
ericsnowcurrently added 13 commits September 14, 2017 17:09
@ericsnowcurrently
Add _PyImport_EnsureInitialized().
12f55d3
@ericsnowcurrently
Add _PyModule_Create2().
eb2d6f9
@ericsnowcurrently
Use _PyModule_Create2() for key builtin modules.
6a04c1c
@ericsnowcurrently
Check sys.modules in _PyImport_EnsureInitialized().
26bdb7e
@ericsnowcurrently
Pass the modules dict to _PyImport_FixupBuiltin().
eac7403
@ericsnowcurrently
Pass PyInterpreterState to _PyImport_GetModuleDict().
1166c57
@ericsnowcurrently
Drop _PyImport_GetModuleDict().
da3ce95
@ericsnowcurrently
_PyModule_Create2 -> _PyModule_CreateInitialized
ef17b81
@ericsnowcurrently
_PyImport_EnsureInitialized() -> _PyImport_IsInitialized()
a17d5ff
@ericsnowcurrently
Add a Misc/NEWS entry.
acc270b
@ericsnowcurrently
Fix style (bracket placement).
bc6a0f1
@ericsnowcurrently
Drop _PyImport_FixupExtensionObjectEx().
c7a2524
@ericsnowcurrently
Fix the NEWS entry.
aceaacd
@ericsnowcurrently
ericsnowcurrently force-pushed the isolate-interp-modules branch from 6714fd9 to aceaacd Compare September 14, 2017 17:10
@ericsnowcurrently
Drop commented-out code.
5b87111
@ericsnowcurrently
ericsnowcurrently merged commit d393c1b into python:master Sep 14, 2017
@ericsnowcurrently
ericsnowcurrently deleted the isolate-interp-modules branch September 14, 2017 18:32
@Mariatta Mariatta removed the awaiting merge label Oct 8, 2017
@ericsnowcurrently ericsnowcurrently mentioned this pull request Apr 10, 2022
[subinterpreters] Eliminate PyInterpreterState.modules. #72597
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@ericsnowcurrently @Mariatta @the-knights-who-say-ni @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.