summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-05-24 12:01:39 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-05-24 12:01:39 (GMT)
commit9bcfacd4fcf64ee7f6e0d05b5d0894c10cd43fc0 (patch)
treef614abbfacb024ba9aa7695ad169c403df53490d
parent79d1b1ce3fdfd6f62d77f6096e1bc61ee2170cdf (diff)
downloadcpython-9bcfacd4fcf64ee7f6e0d05b5d0894c10cd43fc0.zip
cpython-9bcfacd4fcf64ee7f6e0d05b5d0894c10cd43fc0.tar.gz
cpython-9bcfacd4fcf64ee7f6e0d05b5d0894c10cd43fc0.tar.bz2
Issue #12167: packaging.tests.test_dist unloads the temporary module
Fix a reference leak.
-rw-r--r--Lib/packaging/tests/test_dist.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/packaging/tests/test_dist.py b/Lib/packaging/tests/test_dist.py
index 74c727b..fb6d524 100644
--- a/Lib/packaging/tests/test_dist.py
+++ b/Lib/packaging/tests/test_dist.py
@@ -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