Commits

Amaury Forgeot d'Arc  committed cb55d14

test_bz2: Use the "with" statement because del won't close the file
and exceed ulimit.

  • Participants
  • Parent commits f947138
  • Branches py3k

Comments (0)

Files changed (1)

File lib-python/3.2/test/test_bz2.py

         # "Test opening and deleting a file many times"
         self.createTempFile()
         for i in range(10000):
-            o = BZ2File(self.filename)
-            del o
+            if support.check_impl_detail(pypy=True):
+                with BZ2File(self.filename) as o:
+                    pass
+            else:
+                o = BZ2File(self.filename)
+                del o
 
     def testOpenNonexistent(self):
         # "Test opening a nonexistent file"