mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
bpo-41344: Raise ValueError when creating shared memory of size 0 (GH-21556)
This commit is contained in:
parent
582f13786b
commit
475a5fbb56
3 changed files with 15 additions and 0 deletions
|
@ -76,6 +76,8 @@ class SharedMemory:
|
|||
raise ValueError("'size' must be a positive integer")
|
||||
if create:
|
||||
self._flags = _O_CREX | os.O_RDWR
|
||||
if size == 0:
|
||||
raise ValueError("'size' must be a positive number different from zero")
|
||||
if name is None and not self._flags & os.O_EXCL:
|
||||
raise ValueError("'name' can only be None if create=True")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue