mirror of
https://github.com/python/cpython.git
synced 2025-09-28 03:13:48 +00:00
gh-113536: Expose os.waitid
on macOS (#113542)
* gh-113536: Expose `os.waitid` on macOS This API has been available on macOS for a long time, but was explicitly excluded due to unspecified problems with the API in ancient versions of macOS. * Document that the API is available on macOS starting in Python 3.13
This commit is contained in:
parent
5f3cc90a12
commit
d0b0e3d2ef
4 changed files with 14 additions and 13 deletions
|
@ -4986,11 +4986,11 @@ written in Python, such as a mail server's external command delivery program.
|
||||||
|
|
||||||
.. availability:: Unix, not Emscripten, not WASI.
|
.. availability:: Unix, not Emscripten, not WASI.
|
||||||
|
|
||||||
.. note::
|
|
||||||
This function is not available on macOS.
|
|
||||||
|
|
||||||
.. versionadded:: 3.3
|
.. versionadded:: 3.3
|
||||||
|
|
||||||
|
.. versionchanged:: 3.13
|
||||||
|
This function is now available on macOS as well.
|
||||||
|
|
||||||
|
|
||||||
.. function:: waitpid(pid, options, /)
|
.. function:: waitpid(pid, options, /)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
:func:`os.waitid` is now available on macOS
|
6
Modules/clinic/posixmodule.c.h
generated
6
Modules/clinic/posixmodule.c.h
generated
|
@ -5467,7 +5467,7 @@ exit:
|
||||||
|
|
||||||
#endif /* defined(HAVE_WAIT4) */
|
#endif /* defined(HAVE_WAIT4) */
|
||||||
|
|
||||||
#if (defined(HAVE_WAITID) && !defined(__APPLE__))
|
#if defined(HAVE_WAITID)
|
||||||
|
|
||||||
PyDoc_STRVAR(os_waitid__doc__,
|
PyDoc_STRVAR(os_waitid__doc__,
|
||||||
"waitid($module, idtype, id, options, /)\n"
|
"waitid($module, idtype, id, options, /)\n"
|
||||||
|
@ -5510,7 +5510,7 @@ exit:
|
||||||
return return_value;
|
return return_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* (defined(HAVE_WAITID) && !defined(__APPLE__)) */
|
#endif /* defined(HAVE_WAITID) */
|
||||||
|
|
||||||
#if defined(HAVE_WAITPID)
|
#if defined(HAVE_WAITPID)
|
||||||
|
|
||||||
|
@ -12422,4 +12422,4 @@ os__supports_virtual_terminal(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||||
#ifndef OS__SUPPORTS_VIRTUAL_TERMINAL_METHODDEF
|
#ifndef OS__SUPPORTS_VIRTUAL_TERMINAL_METHODDEF
|
||||||
#define OS__SUPPORTS_VIRTUAL_TERMINAL_METHODDEF
|
#define OS__SUPPORTS_VIRTUAL_TERMINAL_METHODDEF
|
||||||
#endif /* !defined(OS__SUPPORTS_VIRTUAL_TERMINAL_METHODDEF) */
|
#endif /* !defined(OS__SUPPORTS_VIRTUAL_TERMINAL_METHODDEF) */
|
||||||
/*[clinic end generated code: output=b82391c4f58231b6 input=a9049054013a1b77]*/
|
/*[clinic end generated code: output=18c128534c355d84 input=a9049054013a1b77]*/
|
||||||
|
|
|
@ -1024,7 +1024,7 @@ typedef struct {
|
||||||
PyObject *TerminalSizeType;
|
PyObject *TerminalSizeType;
|
||||||
PyObject *TimesResultType;
|
PyObject *TimesResultType;
|
||||||
PyObject *UnameResultType;
|
PyObject *UnameResultType;
|
||||||
#if defined(HAVE_WAITID) && !defined(__APPLE__)
|
#if defined(HAVE_WAITID)
|
||||||
PyObject *WaitidResultType;
|
PyObject *WaitidResultType;
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_WAIT3) || defined(HAVE_WAIT4)
|
#if defined(HAVE_WAIT3) || defined(HAVE_WAIT4)
|
||||||
|
@ -2292,7 +2292,7 @@ static PyStructSequence_Desc statvfs_result_desc = {
|
||||||
10
|
10
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(HAVE_WAITID) && !defined(__APPLE__)
|
#if defined(HAVE_WAITID)
|
||||||
PyDoc_STRVAR(waitid_result__doc__,
|
PyDoc_STRVAR(waitid_result__doc__,
|
||||||
"waitid_result: Result from waitid.\n\n\
|
"waitid_result: Result from waitid.\n\n\
|
||||||
This object may be accessed either as a tuple of\n\
|
This object may be accessed either as a tuple of\n\
|
||||||
|
@ -2367,7 +2367,7 @@ _posix_clear(PyObject *module)
|
||||||
Py_CLEAR(state->TerminalSizeType);
|
Py_CLEAR(state->TerminalSizeType);
|
||||||
Py_CLEAR(state->TimesResultType);
|
Py_CLEAR(state->TimesResultType);
|
||||||
Py_CLEAR(state->UnameResultType);
|
Py_CLEAR(state->UnameResultType);
|
||||||
#if defined(HAVE_WAITID) && !defined(__APPLE__)
|
#if defined(HAVE_WAITID)
|
||||||
Py_CLEAR(state->WaitidResultType);
|
Py_CLEAR(state->WaitidResultType);
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_WAIT3) || defined(HAVE_WAIT4)
|
#if defined(HAVE_WAIT3) || defined(HAVE_WAIT4)
|
||||||
|
@ -2392,7 +2392,7 @@ _posix_traverse(PyObject *module, visitproc visit, void *arg)
|
||||||
Py_VISIT(state->TerminalSizeType);
|
Py_VISIT(state->TerminalSizeType);
|
||||||
Py_VISIT(state->TimesResultType);
|
Py_VISIT(state->TimesResultType);
|
||||||
Py_VISIT(state->UnameResultType);
|
Py_VISIT(state->UnameResultType);
|
||||||
#if defined(HAVE_WAITID) && !defined(__APPLE__)
|
#if defined(HAVE_WAITID)
|
||||||
Py_VISIT(state->WaitidResultType);
|
Py_VISIT(state->WaitidResultType);
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_WAIT3) || defined(HAVE_WAIT4)
|
#if defined(HAVE_WAIT3) || defined(HAVE_WAIT4)
|
||||||
|
@ -9518,7 +9518,7 @@ os_wait4_impl(PyObject *module, pid_t pid, int options)
|
||||||
#endif /* HAVE_WAIT4 */
|
#endif /* HAVE_WAIT4 */
|
||||||
|
|
||||||
|
|
||||||
#if defined(HAVE_WAITID) && !defined(__APPLE__)
|
#if defined(HAVE_WAITID)
|
||||||
/*[clinic input]
|
/*[clinic input]
|
||||||
os.waitid
|
os.waitid
|
||||||
|
|
||||||
|
@ -9575,7 +9575,7 @@ os_waitid_impl(PyObject *module, idtype_t idtype, id_t id, int options)
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endif /* defined(HAVE_WAITID) && !defined(__APPLE__) */
|
#endif /* defined(HAVE_WAITID) */
|
||||||
|
|
||||||
|
|
||||||
#if defined(HAVE_WAITPID)
|
#if defined(HAVE_WAITPID)
|
||||||
|
@ -17309,7 +17309,7 @@ posixmodule_exec(PyObject *m)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_WAITID) && !defined(__APPLE__)
|
#if defined(HAVE_WAITID)
|
||||||
waitid_result_desc.name = MODNAME ".waitid_result";
|
waitid_result_desc.name = MODNAME ".waitid_result";
|
||||||
state->WaitidResultType = (PyObject *)PyStructSequence_NewType(&waitid_result_desc);
|
state->WaitidResultType = (PyObject *)PyStructSequence_NewType(&waitid_result_desc);
|
||||||
if (PyModule_AddObjectRef(m, "waitid_result", state->WaitidResultType) < 0) {
|
if (PyModule_AddObjectRef(m, "waitid_result", state->WaitidResultType) < 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue