We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6745906 commit 96d7a42Copy full SHA for 96d7a42
1 file changed
Lib/test/_test_multiprocessing.py
@@ -4935,11 +4935,11 @@ def test_shared_memory_cleaned_after_process_termination(self):
4935
def test_shared_memory_slice_assignment_no_crash(self):
4936
from multiprocessing import shared_memory
4937
shm = shared_memory.SharedMemory(create=True, size=10)
4938
- try:
4939
- shm.buf[:5] = b'hello'
4940
- finally:
4941
- shm.close()
4942
- shm.unlink()
+ mv = shm.buf
+ shm.close()
+ shm.unlink()
+ with self.assertRaises(BufferError):
+ mv[:5] = b'hello'
4943
4944
@unittest.skipIf(os.name != "posix", "resource_tracker is posix only")
4945
@resource_tracker_format_subtests
0 commit comments