Skip to content

Commit 96d7a42

Browse files
Update Test
1 parent 6745906 commit 96d7a42

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Lib/test/_test_multiprocessing.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4935,11 +4935,11 @@ def test_shared_memory_cleaned_after_process_termination(self):
49354935
def test_shared_memory_slice_assignment_no_crash(self):
49364936
from multiprocessing import shared_memory
49374937
shm = shared_memory.SharedMemory(create=True, size=10)
4938-
try:
4939-
shm.buf[:5] = b'hello'
4940-
finally:
4941-
shm.close()
4942-
shm.unlink()
4938+
mv = shm.buf
4939+
shm.close()
4940+
shm.unlink()
4941+
with self.assertRaises(BufferError):
4942+
mv[:5] = b'hello'
49434943

49444944
@unittest.skipIf(os.name != "posix", "resource_tracker is posix only")
49454945
@resource_tracker_format_subtests

0 commit comments

Comments
 (0)