[Python-checkins] cpython: Issue #12167: packaging.tests.test_dist unloads the temporary module

victor.stinner python-checkins at python.org
Tue May 24 14:01:52 CEST 2011


http://hg.python.org/cpython/rev/28c1f8480090
changeset:   70330:28c1f8480090
user:        Victor Stinner <victor.stinner at haypocalc.com>
date:        Tue May 24 14:01:39 2011 +0200
summary:
  Issue #12167: packaging.tests.test_dist unloads the temporary module

Fix a reference leak.

files:
  Lib/packaging/tests/test_dist.py |  2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)


diff --git a/Lib/packaging/tests/test_dist.py b/Lib/packaging/tests/test_dist.py
--- a/Lib/packaging/tests/test_dist.py
+++ b/Lib/packaging/tests/test_dist.py
@@ -13,6 +13,7 @@
 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 @@
         # 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

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list