diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
commit | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch) | |
tree | 64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/tools/python3/src/Modules/_io/clinic/iobase.c.h | |
parent | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff) | |
download | ydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Modules/_io/clinic/iobase.c.h')
-rw-r--r-- | contrib/tools/python3/src/Modules/_io/clinic/iobase.c.h | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/contrib/tools/python3/src/Modules/_io/clinic/iobase.c.h b/contrib/tools/python3/src/Modules/_io/clinic/iobase.c.h index 82ab4a7f27..ddaff7b5d1 100644 --- a/contrib/tools/python3/src/Modules/_io/clinic/iobase.c.h +++ b/contrib/tools/python3/src/Modules/_io/clinic/iobase.c.h @@ -174,7 +174,7 @@ PyDoc_STRVAR(_io__IOBase_readline__doc__, "terminator(s) recognized."); #define _IO__IOBASE_READLINE_METHODDEF \ - {"readline", (PyCFunction)(void(*)(void))_io__IOBase_readline, METH_FASTCALL, _io__IOBase_readline__doc__}, + {"readline", (PyCFunction)(void(*)(void))_io__IOBase_readline, METH_FASTCALL, _io__IOBase_readline__doc__}, static PyObject * _io__IOBase_readline_impl(PyObject *self, Py_ssize_t limit); @@ -185,16 +185,16 @@ _io__IOBase_readline(PyObject *self, PyObject *const *args, Py_ssize_t nargs) PyObject *return_value = NULL; Py_ssize_t limit = -1; - if (!_PyArg_CheckPositional("readline", nargs, 0, 1)) { + if (!_PyArg_CheckPositional("readline", nargs, 0, 1)) { goto exit; } - if (nargs < 1) { - goto skip_optional; - } - if (!_Py_convert_optional_to_ssize_t(args[0], &limit)) { - goto exit; - } -skip_optional: + if (nargs < 1) { + goto skip_optional; + } + if (!_Py_convert_optional_to_ssize_t(args[0], &limit)) { + goto exit; + } +skip_optional: return_value = _io__IOBase_readline_impl(self, limit); exit: @@ -212,7 +212,7 @@ PyDoc_STRVAR(_io__IOBase_readlines__doc__, "lines so far exceeds hint."); #define _IO__IOBASE_READLINES_METHODDEF \ - {"readlines", (PyCFunction)(void(*)(void))_io__IOBase_readlines, METH_FASTCALL, _io__IOBase_readlines__doc__}, + {"readlines", (PyCFunction)(void(*)(void))_io__IOBase_readlines, METH_FASTCALL, _io__IOBase_readlines__doc__}, static PyObject * _io__IOBase_readlines_impl(PyObject *self, Py_ssize_t hint); @@ -223,16 +223,16 @@ _io__IOBase_readlines(PyObject *self, PyObject *const *args, Py_ssize_t nargs) PyObject *return_value = NULL; Py_ssize_t hint = -1; - if (!_PyArg_CheckPositional("readlines", nargs, 0, 1)) { + if (!_PyArg_CheckPositional("readlines", nargs, 0, 1)) { + goto exit; + } + if (nargs < 1) { + goto skip_optional; + } + if (!_Py_convert_optional_to_ssize_t(args[0], &hint)) { goto exit; } - if (nargs < 1) { - goto skip_optional; - } - if (!_Py_convert_optional_to_ssize_t(args[0], &hint)) { - goto exit; - } -skip_optional: +skip_optional: return_value = _io__IOBase_readlines_impl(self, hint); exit: @@ -242,11 +242,11 @@ exit: PyDoc_STRVAR(_io__IOBase_writelines__doc__, "writelines($self, lines, /)\n" "--\n" -"\n" -"Write a list of lines to stream.\n" -"\n" -"Line separators are not added, so it is usual for each of the\n" -"lines provided to have a line separator at the end."); +"\n" +"Write a list of lines to stream.\n" +"\n" +"Line separators are not added, so it is usual for each of the\n" +"lines provided to have a line separator at the end."); #define _IO__IOBASE_WRITELINES_METHODDEF \ {"writelines", (PyCFunction)_io__IOBase_writelines, METH_O, _io__IOBase_writelines__doc__}, @@ -257,7 +257,7 @@ PyDoc_STRVAR(_io__RawIOBase_read__doc__, "\n"); #define _IO__RAWIOBASE_READ_METHODDEF \ - {"read", (PyCFunction)(void(*)(void))_io__RawIOBase_read, METH_FASTCALL, _io__RawIOBase_read__doc__}, + {"read", (PyCFunction)(void(*)(void))_io__RawIOBase_read, METH_FASTCALL, _io__RawIOBase_read__doc__}, static PyObject * _io__RawIOBase_read_impl(PyObject *self, Py_ssize_t n); @@ -268,30 +268,30 @@ _io__RawIOBase_read(PyObject *self, PyObject *const *args, Py_ssize_t nargs) PyObject *return_value = NULL; Py_ssize_t n = -1; - if (!_PyArg_CheckPositional("read", nargs, 0, 1)) { + if (!_PyArg_CheckPositional("read", nargs, 0, 1)) { + goto exit; + } + if (nargs < 1) { + goto skip_optional; + } + if (PyFloat_Check(args[0])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); goto exit; } - if (nargs < 1) { - goto skip_optional; - } - if (PyFloat_Check(args[0])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } - { - Py_ssize_t ival = -1; - PyObject *iobj = PyNumber_Index(args[0]); - if (iobj != NULL) { - ival = PyLong_AsSsize_t(iobj); - Py_DECREF(iobj); - } - if (ival == -1 && PyErr_Occurred()) { - goto exit; - } - n = ival; - } -skip_optional: + { + Py_ssize_t ival = -1; + PyObject *iobj = PyNumber_Index(args[0]); + if (iobj != NULL) { + ival = PyLong_AsSsize_t(iobj); + Py_DECREF(iobj); + } + if (ival == -1 && PyErr_Occurred()) { + goto exit; + } + n = ival; + } +skip_optional: return_value = _io__RawIOBase_read_impl(self, n); exit: @@ -315,4 +315,4 @@ _io__RawIOBase_readall(PyObject *self, PyObject *Py_UNUSED(ignored)) { return _io__RawIOBase_readall_impl(self); } -/*[clinic end generated code: output=61b6ea7153ef9940 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=61b6ea7153ef9940 input=a9049054013a1b77]*/ |