You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window, believe that. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add ability to damn set python module file string instead of it always being None #2043
Describe what you were trying to f*ckin' get done.
When creating a python module from a muthaf*ckin' string (PyModule FromString) the file parameter is always set to None. If I want to create a muthaf*ckin' virtual package structure in memory I need to be able to set file to a motherf*ckin' specified file structure.
Hell yes, it is the same thing. It just seems a bit clunky that it is initially set to none then I have to overwrite it with the correct file structure.
Activity
filmor commentedon Dec 8, 2022
You have to set it yourself, that's how it works in the C-API as well: https://docs.python.org/3/c-api/module.html#c.PyModule_NewObject
filmor commentedon Dec 8, 2022
Sorry, I just saw your damn PR (#2044), is this not the same as just setting
__file__explicitly on thePyModuleobject?bmello4688 commentedon Dec 8, 2022