Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9bcfacd

Browse files
author
Victor Stinner
committed
Issue #12167: packaging.tests.test_dist unloads the temporary module
Fix a reference leak.
1 parent 79d1b1c commit 9bcfacd

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Lib/packaging/tests/test_dist.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from packaging.tests import TESTFN, captured_stdout
1414
from packaging.tests import support, unittest
1515
from packaging.tests.support import create_distribution
16+
from test.support import unload
1617

1718

1819
class test_dist(Command):
@@ -224,6 +225,7 @@ def log_post_call(cmd):
224225
# prepare the call recorders
225226
sys.path.append(temp_home)
226227
self.addCleanup(sys.path.remove, temp_home)
228+
self.addCleanup(unload, module_name)
227229
record = __import__(module_name).record
228230

229231
old_run = cmd.run

0 commit comments

Comments
 (0)