summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-11-25 21:21:32 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-11-25 21:21:32 (GMT)
commit3e7e069887945e2cce76c202ab0822d3032c18e9 (patch)
treea253f138fbf5978a709f064259d2a6f80c4e4aba
parent5f95257ef9a4ec72963b6bb5f6b056a52d5c010f (diff)
downloadcpython-3e7e069887945e2cce76c202ab0822d3032c18e9.zip
cpython-3e7e069887945e2cce76c202ab0822d3032c18e9.tar.gz
cpython-3e7e069887945e2cce76c202ab0822d3032c18e9.tar.bz2
Second fix for issue #4373
-rw-r--r--Lib/distutils/tests/test_build_ext.py10
-rw-r--r--Misc/NEWS3
2 files changed, 12 insertions, 1 deletions
diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py
index 552a3d1..5275297 100644
--- a/Lib/distutils/tests/test_build_ext.py
+++ b/Lib/distutils/tests/test_build_ext.py
@@ -11,6 +11,10 @@ from distutils import sysconfig
import unittest
from test import support
+# http://bugs.python.org/issue4373
+# Don't load the xx module more than once.
+ALREADY_TESTED = False
+
class BuildExtTestCase(unittest.TestCase):
def setUp(self):
# Create a simple test environment
@@ -23,6 +27,7 @@ class BuildExtTestCase(unittest.TestCase):
shutil.copy(xx_c, self.tmp_dir)
def test_build_ext(self):
+ global ALREADY_TESTED
xx_c = os.path.join(self.tmp_dir, 'xxmodule.c')
xx_ext = Extension('xx', [xx_c])
dist = Distribution({'name': 'xx', 'ext_modules': [xx_ext]})
@@ -45,6 +50,11 @@ class BuildExtTestCase(unittest.TestCase):
finally:
sys.stdout = old_stdout
+ if ALREADY_TESTED:
+ return
+ else:
+ ALREADY_TESTED = True
+
import xx
for attr in ('error', 'foo', 'new', 'roj'):
diff --git a/Misc/NEWS b/Misc/NEWS
index 50a3331..535cca4 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -22,7 +22,8 @@ Core and Builtins
Library
-------
-- Issue #4373: Corrected a potential reference leak in the pickle module.
+- Issue #4373: Corrected a potential reference leak in the pickle module and
+ silenced a false positive ref leak in distutils.tests.test_build_ext.
- Issue #4382: dbm.dumb did not specify the expected file encoding for opened
files.