aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGES.txt6
-rw-r--r--setuptools/tests/test_dist_info.py8
2 files changed, 12 insertions, 2 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 12b4907a..9513ed45 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -3,6 +3,12 @@ CHANGES
=======
------
+0.6.31
+------
+
+* Issue #329: Properly close files created by tests for compatibility with Jython.
+
+------
0.6.30
------
diff --git a/setuptools/tests/test_dist_info.py b/setuptools/tests/test_dist_info.py
index 623ccc47..fcb78c36 100644
--- a/setuptools/tests/test_dist_info.py
+++ b/setuptools/tests/test_dist_info.py
@@ -50,7 +50,8 @@ class TestDistInfo(unittest.TestCase):
versioned = os.path.join(self.tmpdir,
'VersionedDistribution-2.718.dist-info')
os.mkdir(versioned)
- open(os.path.join(versioned, 'METADATA'), 'w+').write(DALS(
+ metadata_file = open(os.path.join(versioned, 'METADATA'), 'w+')
+ metadata_file.write(DALS(
"""
Metadata-Version: 1.2
Name: VersionedDistribution
@@ -58,11 +59,13 @@ class TestDistInfo(unittest.TestCase):
Provides-Extra: baz
Requires-Dist: quux (>=1.1); extra == 'baz'
"""))
+ metadata_file.close()
unversioned = os.path.join(self.tmpdir,
'UnversionedDistribution.dist-info')
os.mkdir(unversioned)
- open(os.path.join(unversioned, 'METADATA'), 'w+').write(DALS(
+ metadata_file = open(os.path.join(unversioned, 'METADATA'), 'w+')
+ metadata_file.write(DALS(
"""
Metadata-Version: 1.2
Name: UnversionedDistribution
@@ -71,6 +74,7 @@ class TestDistInfo(unittest.TestCase):
Provides-Extra: baz
Requires-Dist: quux (>=1.1); extra == 'baz'
"""))
+ metadata_file.close()
def tearDown(self):
shutil.rmtree(self.tmpdir)