Skip to content

Commit b98c4fb

Browse files
committed
Fix memory leak buildbots.
1 parent e6c3039 commit b98c4fb

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

Lib/test/test_memoryio.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -725,22 +725,6 @@ def test_newline_argument(self):
725725
for newline in (None, "", "\n", "\r", "\r\n"):
726726
self.ioclass(newline=newline)
727727

728-
@unittest.skipUnless(support.Py_GIL_DISABLED, "only meaningful under free-threading")
729-
@threading_helper.requires_working_threading()
730-
def test_concurrent_use(self):
731-
memio = self.ioclass("")
732-
733-
def use():
734-
memio.write("x" * 10)
735-
memio.readlines()
736-
737-
threads = [threading.Thread(target=use) for _ in range(8)]
738-
with threading_helper.catch_threading_exception() as cm:
739-
with threading_helper.start_threads(threads):
740-
pass
741-
742-
self.assertIsNone(cm.exc_value)
743-
744728

745729
class PyStringIOTest(MemoryTestMixin, MemorySeekTestMixin,
746730
TextIOTestMixin, unittest.TestCase):
@@ -907,6 +891,24 @@ def test_setstate(self):
907891
memio.close()
908892
self.assertRaises(ValueError, memio.__setstate__, ("closed", "", 0, None))
909893

894+
@unittest.skipUnless(support.Py_GIL_DISABLED, "only meaningful under free-threading")
895+
@threading_helper.requires_working_threading()
896+
def test_concurrent_use(self):
897+
memio = self.ioclass("")
898+
899+
def use():
900+
memio.write("x" * 10)
901+
memio.readlines()
902+
903+
threads = [threading.Thread(target=use) for _ in range(8)]
904+
with threading_helper.catch_threading_exception() as cm:
905+
with threading_helper.start_threads(threads):
906+
pass
907+
908+
if cm.exc_value is not None:
909+
raise cm.exc_value
910+
911+
910912

911913

912914
class CStringIOPickleTest(PyStringIOPickleTest):

0 commit comments

Comments
 (0)