Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-102251: Updates to test_imp Toward Fixing Some Refleaks #102254

Merged
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