bpo-38378: Rename parameters "out" and "in" of os.sendfile(). (GH-16742)
They conflicted with keyword "in".
Also rename positional-only parameters of private os._fcopyfile()
for consistency.
diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h
index 00b05f7..561cbb0 100644
--- a/Modules/clinic/posixmodule.c.h
+++ b/Modules/clinic/posixmodule.c.h
@@ -4986,7 +4986,7 @@
#if defined(__APPLE__)
PyDoc_STRVAR(os__fcopyfile__doc__,
-"_fcopyfile($module, infd, outfd, flags, /)\n"
+"_fcopyfile($module, in_fd, out_fd, flags, /)\n"
"--\n"
"\n"
"Efficiently copy content or metadata of 2 regular file descriptors (macOS).");
@@ -4995,14 +4995,14 @@
{"_fcopyfile", (PyCFunction)(void(*)(void))os__fcopyfile, METH_FASTCALL, os__fcopyfile__doc__},
static PyObject *
-os__fcopyfile_impl(PyObject *module, int infd, int outfd, int flags);
+os__fcopyfile_impl(PyObject *module, int in_fd, int out_fd, int flags);
static PyObject *
os__fcopyfile(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
{
PyObject *return_value = NULL;
- int infd;
- int outfd;
+ int in_fd;
+ int out_fd;
int flags;
if (!_PyArg_CheckPositional("_fcopyfile", nargs, 3, 3)) {
@@ -5013,8 +5013,8 @@
"integer argument expected, got float" );
goto exit;
}
- infd = _PyLong_AsInt(args[0]);
- if (infd == -1 && PyErr_Occurred()) {
+ in_fd = _PyLong_AsInt(args[0]);
+ if (in_fd == -1 && PyErr_Occurred()) {
goto exit;
}
if (PyFloat_Check(args[1])) {
@@ -5022,8 +5022,8 @@
"integer argument expected, got float" );
goto exit;
}
- outfd = _PyLong_AsInt(args[1]);
- if (outfd == -1 && PyErr_Occurred()) {
+ out_fd = _PyLong_AsInt(args[1]);
+ if (out_fd == -1 && PyErr_Occurred()) {
goto exit;
}
if (PyFloat_Check(args[2])) {
@@ -5035,7 +5035,7 @@
if (flags == -1 && PyErr_Occurred()) {
goto exit;
}
- return_value = os__fcopyfile_impl(module, infd, outfd, flags);
+ return_value = os__fcopyfile_impl(module, in_fd, out_fd, flags);
exit:
return return_value;
@@ -8731,4 +8731,4 @@
#ifndef OS__REMOVE_DLL_DIRECTORY_METHODDEF
#define OS__REMOVE_DLL_DIRECTORY_METHODDEF
#endif /* !defined(OS__REMOVE_DLL_DIRECTORY_METHODDEF) */
-/*[clinic end generated code: output=799c75140d84ace5 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=fe7897441fed5402 input=a9049054013a1b77]*/