Skip to content

Commit e53e903

Browse files
committed
Remove redundant set of newcontext
1 parent 2e4e587 commit e53e903

1 file changed

Lines changed: 0 additions & 13 deletions

File tree

‎Python/import.c‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2517,19 +2517,6 @@ create_builtin(
25172517
if (_Py_ext_module_loader_info_init(&info, name, spec, origin) < 0) {
25182518
return NULL;
25192519
}
2520-
if (initfunc != NULL) {
2521-
/* An explicitly provided init function (see
2522-
* PyImport_CreateModuleFromInitfunc()) may belong to a submodule
2523-
* whose single-phase init creates the module using only the last
2524-
* component of the name (as e.g. pybind11 does). Set the package
2525-
* context so that PyModule_Create() resolves the full name, the
2526-
* same as for dynamically loaded extensions. */
2527-
info.newcontext = PyUnicode_AsUTF8(info.name);
2528-
if (info.newcontext == NULL) {
2529-
_Py_ext_module_loader_info_clear(&info);
2530-
return NULL;
2531-
}
2532-
}
25332520

25342521
struct extensions_cache_value *cached = NULL;
25352522
PyObject *mod = import_find_extension(tstate, &info, &cached);

0 commit comments

Comments
 (0)