Commit 4cbab346 authored by Brett Cannon's avatar Brett Cannon

Issue #26397: Update an importlib example to use util.module_from_spec() instead of create_module()

parent fe1941eb
......@@ -1389,7 +1389,7 @@ Python 3.6 and newer for other parts of the code).
break
else:
raise ImportError(f'No module named {absolute_name!r}')
module = spec.loader.create_module(spec)
module = util.module_from_spec(spec)
spec.loader.exec_module(module)
sys.modules[absolute_name] = module
if path is not None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment