Skip to content

Commit

Permalink
pythongh-117873: Use positional-only parameters in _posixshmem (pytho…
Browse files Browse the repository at this point in the history
…n#118012)

* shm_unlink() parameter becomes positional-only.
* shm_open() first parameter (path) becomes positional-only,
  the two following parameters remain positional-or-keyword.
  • Loading branch information
vstinner authored May 10, 2024
1 parent e85e8de commit 7cc5e81
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
19 changes: 10 additions & 9 deletions Modules/_multiprocessing/clinic/posixshmem.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Modules/_multiprocessing/posixshmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module _posixshmem
/*[clinic input]
_posixshmem.shm_open -> int
path: unicode
/
flags: int
mode: int = 0o777
Expand All @@ -44,7 +45,7 @@ Open a shared memory object. Returns a file descriptor (integer).
static int
_posixshmem_shm_open_impl(PyObject *module, PyObject *path, int flags,
int mode)
/*[clinic end generated code: output=8d110171a4fa20df input=e83b58fa802fac25]*/
/*[clinic end generated code: output=8d110171a4fa20df input=0585935e1d3c8050]*/
{
int fd;
int async_err = 0;
Expand Down Expand Up @@ -77,6 +78,7 @@ _posixshmem_shm_open_impl(PyObject *module, PyObject *path, int flags,
/*[clinic input]
_posixshmem.shm_unlink
path: unicode
/
Remove a shared memory object (similar to unlink()).
Expand All @@ -88,7 +90,7 @@ region.

static PyObject *
_posixshmem_shm_unlink_impl(PyObject *module, PyObject *path)
/*[clinic end generated code: output=42f8b23d134b9ff5 input=8dc0f87143e3b300]*/
/*[clinic end generated code: output=42f8b23d134b9ff5 input=298369d013dcad63]*/
{
int rv;
int async_err = 0;
Expand Down

0 comments on commit 7cc5e81

Please sign in to comment.