gh-117953: Split Up _PyImport_LoadDynamicModuleWithSpec() by ericsnowcurrently · Pull Request #118203 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions Include/internal/pycore_import.h
11 changes: 9 additions & 2 deletions Include/internal/pycore_importdl.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,17 @@ extern int _Py_ext_module_loader_info_init_from_spec(
struct _Py_ext_module_loader_info *info,
PyObject *spec);

extern PyObject *_PyImport_LoadDynamicModuleWithSpec(
struct _Py_ext_module_loader_result {
PyModuleDef *def;
PyObject *module;
};
extern PyModInitFunction _PyImport_GetModInitFunc(
struct _Py_ext_module_loader_info *info,
PyObject *spec,
FILE *fp);
extern int _PyImport_RunModInitFunc(
PyModInitFunction p0,
struct _Py_ext_module_loader_info *info,
struct _Py_ext_module_loader_result *p_res);


/* Max length of module suffix searched for -- accommodates "module.slb" */
Expand Down
2 changes: 1 addition & 1 deletion Include/moduleobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ typedef struct PyModuleDef_Base {
/* A copy of the module's __dict__ after the first time it was loaded.
This is only set/used for legacy modules that do not support
multiple initializations.
It is set by _PyImport_FixupExtensionObject(). */
It is set by fix_up_extension() in import.c. */
PyObject* m_copy;
} PyModuleDef_Base;

Expand Down
217 changes: 126 additions & 91 deletions Python/import.c
Loading