Skip to content

Commit 0c65700

Browse files
Use spec_from_file_location() in imp.load_dynamic().
1 parent c6a39e3 commit 0c65700

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/imp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@ def load_dynamic(name, path, file=None):
338338

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

345345
else:

0 commit comments

Comments
 (0)