]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #12167: packaging.tests.test_dist unloads the temporary module
authorVictor Stinner <victor.stinner@haypocalc.com>
Tue, 24 May 2011 12:01:39 +0000 (14:01 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Tue, 24 May 2011 12:01:39 +0000 (14:01 +0200)
Fix a reference leak.

Lib/packaging/tests/test_dist.py

index 74c727bf5eba80a8a6a8e28e71fb1d8e9cb36fa4..fb6d524fdc5f1304166553a438c85c10452b526f 100644 (file)
@@ -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