Commits

Arfrever Frehtes Taifersar Arahesis committed 823f784

Issue #329: Properly close files created by tests for compatibility with Jython.

Comments (0)

Files changed (2)

 =======
 
 ------
+0.6.31
+------
+
+* Issue #329: Properly close files created by tests for compatibility with Jython.
+
+------
 0.6.30
 ------
 

setuptools/tests/test_dist_info.py

         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
             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
             Provides-Extra: baz
             Requires-Dist: quux (>=1.1); extra == 'baz'
             """))
+        metadata_file.close()
 
     def tearDown(self):
         shutil.rmtree(self.tmpdir)