Skip to content

[3.15] gh-157384: Set package context in PyImport_CreateModuleFromInitfunc() (GH-157387) - #159316

Open
miss-islington wants to merge 1 commit into
python:3.15from
miss-islington:backport-0486228-3.15
Open

miss-islington wants to merge 1 commit into
python:3.15from
miss-islington:backport-0486228-3.15

Conversation

@miss-islington

@miss-islington miss-islington commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

A single-phase init function that creates its module using only the
last component of a dotted name (as pybind11 does for submodules) got
a module whose name was the short name. Set the package context
while calling the init function, as the dynamic loader does, so the
module gets the full name from the spec.
(cherry picked from commit 0486228)

Co-authored-by: Itamar Oren itamarost@gmail.com

…func() (pythonGH-157387)

A single-phase init function that creates its module using only the
last component of a dotted name (as pybind11 does for submodules) got
a module whose __name__ was the short name.  Set the package context
while calling the init function, as the dynamic loader does, so the
module gets the full name from the spec.
(cherry picked from commit 0486228)

Co-authored-by: Itamar Oren <itamarost@gmail.com>
@read-the-docs-community

Copy link
Copy Markdown

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