diff options
author | Victor Stinner <vstinner@python.org> | 2023-05-31 17:52:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-31 17:52:33 (GMT) |
commit | dd29ae26f89ba7db596127b6eba83bb3a45c167b (patch) | |
tree | ac7749dd289eefe2388b6316b32bcbd503ae3c9a /Modules | |
parent | c05c31db8c9dfd708b9857bb57f8e5f3ce40266d (diff) | |
download | cpython-dd29ae26f89ba7db596127b6eba83bb3a45c167b.zip cpython-dd29ae26f89ba7db596127b6eba83bb3a45c167b.tar.gz cpython-dd29ae26f89ba7db596127b6eba83bb3a45c167b.tar.bz2 |
gh-105156: Argument Clinic avoids Py_UNICODE type (#105161)
Argument Clinic now uses "const wchar_t*" type instead of
"const Py_UNICODE*" type for the "Py_UNICODE" format.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_winapi.c | 7 | ||||
-rw-r--r-- | Modules/clinic/_winapi.c.h | 11 | ||||
-rw-r--r-- | Modules/clinic/overlapped.c.h | 10 | ||||
-rw-r--r-- | Modules/clinic/posixmodule.c.h | 12 | ||||
-rw-r--r-- | Modules/overlapped.c | 8 | ||||
-rw-r--r-- | Modules/posixmodule.c | 8 |
6 files changed, 27 insertions, 29 deletions
diff --git a/Modules/_winapi.c b/Modules/_winapi.c index bbc9fac..af13014 100644 --- a/Modules/_winapi.c +++ b/Modules/_winapi.c @@ -1058,14 +1058,13 @@ process ID, and thread ID. [clinic start generated code]*/ static PyObject * -_winapi_CreateProcess_impl(PyObject *module, - const Py_UNICODE *application_name, +_winapi_CreateProcess_impl(PyObject *module, const wchar_t *application_name, PyObject *command_line, PyObject *proc_attrs, PyObject *thread_attrs, BOOL inherit_handles, DWORD creation_flags, PyObject *env_mapping, - const Py_UNICODE *current_directory, + const wchar_t *current_directory, PyObject *startup_info) -/*[clinic end generated code: output=9b2423a609230132 input=42ac293eaea03fc4]*/ +/*[clinic end generated code: output=a25c8e49ea1d6427 input=42ac293eaea03fc4]*/ { PyObject *ret = NULL; BOOL result; diff --git a/Modules/clinic/_winapi.c.h b/Modules/clinic/_winapi.c.h index 3767b19..8f46b8f 100644 --- a/Modules/clinic/_winapi.c.h +++ b/Modules/clinic/_winapi.c.h @@ -397,26 +397,25 @@ PyDoc_STRVAR(_winapi_CreateProcess__doc__, {"CreateProcess", _PyCFunction_CAST(_winapi_CreateProcess), METH_FASTCALL, _winapi_CreateProcess__doc__}, static PyObject * -_winapi_CreateProcess_impl(PyObject *module, - const Py_UNICODE *application_name, +_winapi_CreateProcess_impl(PyObject *module, const wchar_t *application_name, PyObject *command_line, PyObject *proc_attrs, PyObject *thread_attrs, BOOL inherit_handles, DWORD creation_flags, PyObject *env_mapping, - const Py_UNICODE *current_directory, + const wchar_t *current_directory, PyObject *startup_info); static PyObject * _winapi_CreateProcess(PyObject *module, PyObject *const *args, Py_ssize_t nargs) { PyObject *return_value = NULL; - const Py_UNICODE *application_name = NULL; + const wchar_t *application_name = NULL; PyObject *command_line; PyObject *proc_attrs; PyObject *thread_attrs; BOOL inherit_handles; DWORD creation_flags; PyObject *env_mapping; - const Py_UNICODE *current_directory = NULL; + const wchar_t *current_directory = NULL; PyObject *startup_info; if (!_PyArg_ParseStack(args, nargs, "O&OOOikOO&O:CreateProcess", @@ -1481,4 +1480,4 @@ exit: return return_value; } -/*[clinic end generated code: output=be1343b3759e0c96 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f32fe6ecdbffd74d input=a9049054013a1b77]*/ diff --git a/Modules/clinic/overlapped.c.h b/Modules/clinic/overlapped.c.h index 9d9f2cb..8992831 100644 --- a/Modules/clinic/overlapped.c.h +++ b/Modules/clinic/overlapped.c.h @@ -273,7 +273,7 @@ PyDoc_STRVAR(_overlapped_CreateEvent__doc__, static PyObject * _overlapped_CreateEvent_impl(PyObject *module, PyObject *EventAttributes, BOOL ManualReset, BOOL InitialState, - const Py_UNICODE *Name); + const wchar_t *Name); static PyObject * _overlapped_CreateEvent(PyObject *module, PyObject *const *args, Py_ssize_t nargs) @@ -282,7 +282,7 @@ _overlapped_CreateEvent(PyObject *module, PyObject *const *args, Py_ssize_t narg PyObject *EventAttributes; BOOL ManualReset; BOOL InitialState; - const Py_UNICODE *Name = NULL; + const wchar_t *Name = NULL; if (!_PyArg_CheckPositional("CreateEvent", nargs, 4, 4)) { goto exit; @@ -1041,13 +1041,13 @@ PyDoc_STRVAR(_overlapped_Overlapped_ConnectPipe__doc__, static PyObject * _overlapped_Overlapped_ConnectPipe_impl(OverlappedObject *self, - const Py_UNICODE *Address); + const wchar_t *Address); static PyObject * _overlapped_Overlapped_ConnectPipe(OverlappedObject *self, PyObject *arg) { PyObject *return_value = NULL; - const Py_UNICODE *Address = NULL; + const wchar_t *Address = NULL; if (!PyUnicode_Check(arg)) { _PyArg_BadArgument("ConnectPipe", "argument", "str", arg); @@ -1262,4 +1262,4 @@ exit: return return_value; } -/*[clinic end generated code: output=b2e89694b8de3d00 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=05fd038b8a81272d input=a9049054013a1b77]*/ diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index 3312bd6..b8f0e5d 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -2793,7 +2793,7 @@ PyDoc_STRVAR(os_system__doc__, {"system", _PyCFunction_CAST(os_system), METH_FASTCALL|METH_KEYWORDS, os_system__doc__}, static long -os_system_impl(PyObject *module, const Py_UNICODE *command); +os_system_impl(PyObject *module, const wchar_t *command); static PyObject * os_system(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) @@ -2825,7 +2825,7 @@ os_system(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k }; #undef KWTUPLE PyObject *argsbuf[1]; - const Py_UNICODE *command = NULL; + const wchar_t *command = NULL; long _return_value; args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf); @@ -9367,7 +9367,7 @@ PyDoc_STRVAR(os_startfile__doc__, static PyObject * os_startfile_impl(PyObject *module, path_t *filepath, - const Py_UNICODE *operation, const Py_UNICODE *arguments, + const wchar_t *operation, const wchar_t *arguments, path_t *cwd, int show_cmd); static PyObject * @@ -9402,8 +9402,8 @@ os_startfile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject PyObject *argsbuf[5]; Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1; path_t filepath = PATH_T_INITIALIZE("startfile", "filepath", 0, 0); - const Py_UNICODE *operation = NULL; - const Py_UNICODE *arguments = NULL; + const wchar_t *operation = NULL; + const wchar_t *arguments = NULL; path_t cwd = PATH_T_INITIALIZE("startfile", "cwd", 1, 0); int show_cmd = 1; @@ -11990,4 +11990,4 @@ exit: #ifndef OS_WAITSTATUS_TO_EXITCODE_METHODDEF #define OS_WAITSTATUS_TO_EXITCODE_METHODDEF #endif /* !defined(OS_WAITSTATUS_TO_EXITCODE_METHODDEF) */ -/*[clinic end generated code: output=9d8b0d6717c9af54 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=02bece83d20d497b input=a9049054013a1b77]*/ diff --git a/Modules/overlapped.c b/Modules/overlapped.c index ac63731..1889950 100644 --- a/Modules/overlapped.c +++ b/Modules/overlapped.c @@ -445,8 +445,8 @@ EventAttributes must be None. static PyObject * _overlapped_CreateEvent_impl(PyObject *module, PyObject *EventAttributes, BOOL ManualReset, BOOL InitialState, - const Py_UNICODE *Name) -/*[clinic end generated code: output=8e04f0916c17b13d input=dbc36ae14375ba24]*/ + const wchar_t *Name) +/*[clinic end generated code: output=b17ddc5fd506972d input=dbc36ae14375ba24]*/ { HANDLE Event; @@ -1600,8 +1600,8 @@ Connect to the pipe for asynchronous I/O (overlapped). static PyObject * _overlapped_Overlapped_ConnectPipe_impl(OverlappedObject *self, - const Py_UNICODE *Address) -/*[clinic end generated code: output=3cc9661667d459d4 input=167c06a274efcefc]*/ + const wchar_t *Address) +/*[clinic end generated code: output=67cbd8e4d3a57855 input=167c06a274efcefc]*/ { HANDLE PipeHandle; diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 8a0c160..1960c63 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -5650,8 +5650,8 @@ Execute the command in a subshell. [clinic start generated code]*/ static long -os_system_impl(PyObject *module, const Py_UNICODE *command) -/*[clinic end generated code: output=5b7c3599c068ca42 input=303f5ce97df606b0]*/ +os_system_impl(PyObject *module, const wchar_t *command) +/*[clinic end generated code: output=dd528cbd5943a679 input=303f5ce97df606b0]*/ { long result; @@ -13571,9 +13571,9 @@ the underlying Win32 ShellExecute function doesn't work if it is. static PyObject * os_startfile_impl(PyObject *module, path_t *filepath, - const Py_UNICODE *operation, const Py_UNICODE *arguments, + const wchar_t *operation, const wchar_t *arguments, path_t *cwd, int show_cmd) -/*[clinic end generated code: output=3baa4f9795841880 input=8248997b80669622]*/ +/*[clinic end generated code: output=1c6f2f3340e31ffa input=8248997b80669622]*/ { HINSTANCE rc; |