Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbb0cf8f

Browse files
gh-102251: Updates to test_imp Toward Fixing Some Refleaks (gh-102254)
This is related to fixing the refleaks introduced by commit096d009. I haven't been able to find the leak yet, but these changes are a consequence of that effort. This includes some cleanup, some tweaks to the existing tests, and a bunch of new test cases. The only change here that might have impact outside the tests in question is in imp.py, where I update imp.load_dynamic() to use spec_from_file_location() instead of creating a ModuleSpec directly.Also note that I've updated the tests to only skip if we're checking for refleaks (regrtest's --huntrleaks), whereas ingh-101969 I had skipped the tests entirely. The tests will be useful for some upcoming work and I'd rather the refleaks not hold that up. (It isn't clear how quickly we'll be able to fix the leaking code, though it will certainly be done in the short term.)#102251
1 parent0db6f44 commitbb0cf8f

File tree

4 files changed

+952
-299
lines changed

4 files changed

+952
-299
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)

[8]ページ先頭

©2009-2025 Movatter.jp