-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
triageNew bug, unverifiedNew bug, unverified
Description
Required prerequisites
- Make sure you've read the documentation. Your issue may be addressed there.
- Search the issue tracker and Discussions to verify that this hasn't already been reported. +1 or comment there if it has.
- Consider asking first in the Gitter chat room or in a Discussion.
What version (or hash if on master) of pybind11 are you using?
Problem description
Pybind's module_::def_submodule
function requires the module to have a __file__
attribute. However, when creating an embedded module this attribute is not set.
I would think that adding submodules is a valid use-case that should not need any workarounds.
Reproducible example code
As a workaround, I am currently setting the attribute manually:
PYBIND11_EMBEDDED_MODULE(x, m) {
m.attr("__file__") = "<embedded>";
m.def_submodule("y");
}
Is this a regression? Put the last known working version here if it is.
The issue was introduced by 8f00d1e. @henryiii maybe you can have a look.
Metadata
Metadata
Assignees
Labels
triageNew bug, unverifiedNew bug, unverified