Discussion:
[Python-3000-checkins] r67382 - in python/branches/py3k: Lib/distutils/tests/test_build_ext.py Misc/NEWS
christian.heimes
2008-11-25 21:21:32 UTC
Permalink
Author: christian.heimes
Date: Tue Nov 25 22:21:32 2008
New Revision: 67382

Log:
Second fix for issue #4373

Modified:
python/branches/py3k/Lib/distutils/tests/test_build_ext.py
python/branches/py3k/Misc/NEWS

Modified: python/branches/py3k/Lib/distutils/tests/test_build_ext.py
==============================================================================
--- python/branches/py3k/Lib/distutils/tests/test_build_ext.py (original)
+++ python/branches/py3k/Lib/distutils/tests/test_build_ext.py Tue Nov 25 22:21:32 2008
@@ -11,6 +11,10 @@
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 @@
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 @@
finally:
sys.stdout = old_stdout

+ if ALREADY_TESTED:
+ return
+ else:
+ ALREADY_TESTED = True
+
import xx

for attr in ('error', 'foo', 'new', 'roj'):

Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS (original)
+++ python/branches/py3k/Misc/NEWS Tue Nov 25 22:21:32 2008
@@ -22,7 +22,8 @@
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.

Loading...