1. Tarek Ziadé
  2. distribute

Commits

Arfrever Frehtes Taifersar Arahesis  committed 823f784

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

  • Participants
  • Parent commits bf75333
  • Branches default

Comments (1)

Files changed (2)

File CHANGES.txt

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

File setuptools/tests/test_dist_info.py

View file
  • Ignore whitespace
         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)