mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Issue #12167: packaging.tests.test_dist unloads the temporary module
Fix a reference leak.
This commit is contained in:
parent
79d1b1ce3f
commit
9bcfacd4fc
1 changed files with 2 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ from packaging.errors import PackagingModuleError, PackagingOptionError
|
|||
from packaging.tests import TESTFN, captured_stdout
|
||||
from packaging.tests import support, unittest
|
||||
from packaging.tests.support import create_distribution
|
||||
from test.support import unload
|
||||
|
||||
|
||||
class test_dist(Command):
|
||||
|
|
@ -224,6 +225,7 @@ class DistributionTestCase(support.TempdirManager,
|
|||
# prepare the call recorders
|
||||
sys.path.append(temp_home)
|
||||
self.addCleanup(sys.path.remove, temp_home)
|
||||
self.addCleanup(unload, module_name)
|
||||
record = __import__(module_name).record
|
||||
|
||||
old_run = cmd.run
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue