Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Use spec_from_file_location() in imp.load_dynamic().
  • Loading branch information
ericsnowcurrently committed Feb 23, 2023
commit 0c65700909bf91843938c2cb9a6add0caa891b65
4 changes: 2 additions & 2 deletions Lib/imp.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,8 @@ def load_dynamic(name, path, file=None):

# Issue #24748: Skip the sys.modules check in _load_module_shim;
# always load new extension
spec = importlib.machinery.ModuleSpec(
name=name, loader=loader, origin=path)
spec = importlib.util.spec_from_file_location(
name, path, loader=loader)
return _load(spec)

else:
Expand Down