diff options
Diffstat (limited to 'Modules/_io')
-rw-r--r-- | Modules/_io/clinic/_iomodule.c.h | 12 | ||||
-rw-r--r-- | Modules/_io/clinic/bufferedio.c.h | 37 | ||||
-rw-r--r-- | Modules/_io/clinic/bytesio.c.h | 12 | ||||
-rw-r--r-- | Modules/_io/clinic/fileio.c.h | 12 | ||||
-rw-r--r-- | Modules/_io/clinic/iobase.c.h | 7 | ||||
-rw-r--r-- | Modules/_io/clinic/stringio.c.h | 12 | ||||
-rw-r--r-- | Modules/_io/clinic/textio.c.h | 32 | ||||
-rw-r--r-- | Modules/_io/clinic/winconsoleio.c.h | 7 | ||||
-rw-r--r-- | Modules/_io/fileio.c | 10 | ||||
-rw-r--r-- | Modules/_io/winconsoleio.c | 6 |
10 files changed, 8 insertions, 139 deletions
diff --git a/Modules/_io/clinic/_iomodule.c.h b/Modules/_io/clinic/_iomodule.c.h index 1a9651d..dc7b5ff 100644 --- a/Modules/_io/clinic/_iomodule.c.h +++ b/Modules/_io/clinic/_iomodule.c.h @@ -178,11 +178,6 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw } } if (args[2]) { - if (PyFloat_Check(args[2])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } buffering = _PyLong_AsInt(args[2]); if (buffering == -1 && PyErr_Occurred()) { goto exit; @@ -261,11 +256,6 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw } } if (args[6]) { - if (PyFloat_Check(args[6])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } closefd = _PyLong_AsInt(args[6]); if (closefd == -1 && PyErr_Occurred()) { goto exit; @@ -323,4 +313,4 @@ _io_open_code(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec exit: return return_value; } -/*[clinic end generated code: output=3df6bc6d91697545 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5c0dd7a262c30ebc input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/bufferedio.c.h b/Modules/_io/clinic/bufferedio.c.h index 56d6332..1961ed9 100644 --- a/Modules/_io/clinic/bufferedio.c.h +++ b/Modules/_io/clinic/bufferedio.c.h @@ -120,11 +120,6 @@ _io__Buffered_peek(buffered *self, PyObject *const *args, Py_ssize_t nargs) 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]); @@ -200,11 +195,6 @@ _io__Buffered_read1(buffered *self, PyObject *const *args, Py_ssize_t nargs) 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]); @@ -356,11 +346,6 @@ _io__Buffered_seek(buffered *self, PyObject *const *args, Py_ssize_t nargs) if (nargs < 2) { goto skip_optional; } - if (PyFloat_Check(args[1])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } whence = _PyLong_AsInt(args[1]); if (whence == -1 && PyErr_Occurred()) { goto exit; @@ -434,11 +419,6 @@ _io_BufferedReader___init__(PyObject *self, PyObject *args, PyObject *kwargs) if (!noptargs) { goto skip_optional_pos; } - if (PyFloat_Check(fastargs[1])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } { Py_ssize_t ival = -1; PyObject *iobj = PyNumber_Index(fastargs[1]); @@ -493,11 +473,6 @@ _io_BufferedWriter___init__(PyObject *self, PyObject *args, PyObject *kwargs) if (!noptargs) { goto skip_optional_pos; } - if (PyFloat_Check(fastargs[1])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } { Py_ssize_t ival = -1; PyObject *iobj = PyNumber_Index(fastargs[1]); @@ -590,11 +565,6 @@ _io_BufferedRWPair___init__(PyObject *self, PyObject *args, PyObject *kwargs) if (PyTuple_GET_SIZE(args) < 3) { goto skip_optional; } - if (PyFloat_Check(PyTuple_GET_ITEM(args, 2))) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } { Py_ssize_t ival = -1; PyObject *iobj = PyNumber_Index(PyTuple_GET_ITEM(args, 2)); @@ -649,11 +619,6 @@ _io_BufferedRandom___init__(PyObject *self, PyObject *args, PyObject *kwargs) if (!noptargs) { goto skip_optional_pos; } - if (PyFloat_Check(fastargs[1])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } { Py_ssize_t ival = -1; PyObject *iobj = PyNumber_Index(fastargs[1]); @@ -672,4 +637,4 @@ skip_optional_pos: exit: return return_value; } -/*[clinic end generated code: output=7d9ad40c95bdd808 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1882bb497ddc9375 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/bytesio.c.h b/Modules/_io/clinic/bytesio.c.h index 83cd490..4720bdd 100644 --- a/Modules/_io/clinic/bytesio.c.h +++ b/Modules/_io/clinic/bytesio.c.h @@ -402,11 +402,6 @@ _io_BytesIO_seek(bytesio *self, PyObject *const *args, Py_ssize_t nargs) if (!_PyArg_CheckPositional("seek", nargs, 1, 2)) { goto exit; } - 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]); @@ -422,11 +417,6 @@ _io_BytesIO_seek(bytesio *self, PyObject *const *args, Py_ssize_t nargs) if (nargs < 2) { goto skip_optional; } - if (PyFloat_Check(args[1])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } whence = _PyLong_AsInt(args[1]); if (whence == -1 && PyErr_Occurred()) { goto exit; @@ -515,4 +505,4 @@ skip_optional_pos: exit: return return_value; } -/*[clinic end generated code: output=4ec2506def9c8eb9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ba0f302f16397741 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/fileio.c.h b/Modules/_io/clinic/fileio.c.h index 53e7067..9b237c1 100644 --- a/Modules/_io/clinic/fileio.c.h +++ b/Modules/_io/clinic/fileio.c.h @@ -87,11 +87,6 @@ _io_FileIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) } } if (fastargs[2]) { - if (PyFloat_Check(fastargs[2])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } closefd = _PyLong_AsInt(fastargs[2]); if (closefd == -1 && PyErr_Occurred()) { goto exit; @@ -351,11 +346,6 @@ _io_FileIO_seek(fileio *self, PyObject *const *args, Py_ssize_t nargs) if (nargs < 2) { goto skip_optional; } - if (PyFloat_Check(args[1])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } whence = _PyLong_AsInt(args[1]); if (whence == -1 && PyErr_Occurred()) { goto exit; @@ -447,4 +437,4 @@ _io_FileIO_isatty(fileio *self, PyObject *Py_UNUSED(ignored)) #ifndef _IO_FILEIO_TRUNCATE_METHODDEF #define _IO_FILEIO_TRUNCATE_METHODDEF #endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */ -/*[clinic end generated code: output=e7682d0a3264d284 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3479912ec0f7e029 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/iobase.c.h b/Modules/_io/clinic/iobase.c.h index ddaff7b..02a2ab8 100644 --- a/Modules/_io/clinic/iobase.c.h +++ b/Modules/_io/clinic/iobase.c.h @@ -274,11 +274,6 @@ _io__RawIOBase_read(PyObject *self, PyObject *const *args, Py_ssize_t nargs) 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]); @@ -315,4 +310,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=1f9ce590549593be input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/stringio.c.h b/Modules/_io/clinic/stringio.c.h index 77a720c..2b32319 100644 --- a/Modules/_io/clinic/stringio.c.h +++ b/Modules/_io/clinic/stringio.c.h @@ -177,11 +177,6 @@ _io_StringIO_seek(stringio *self, PyObject *const *args, Py_ssize_t nargs) if (!_PyArg_CheckPositional("seek", nargs, 1, 2)) { goto exit; } - 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]); @@ -197,11 +192,6 @@ _io_StringIO_seek(stringio *self, PyObject *const *args, Py_ssize_t nargs) if (nargs < 2) { goto skip_optional; } - if (PyFloat_Check(args[1])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } whence = _PyLong_AsInt(args[1]); if (whence == -1 && PyErr_Occurred()) { goto exit; @@ -348,4 +338,4 @@ _io_StringIO_seekable(stringio *self, PyObject *Py_UNUSED(ignored)) { return _io_StringIO_seekable_impl(self); } -/*[clinic end generated code: output=7aad5ab2e64a25b8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9c428b2942d54991 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/textio.c.h b/Modules/_io/clinic/textio.c.h index b8b5075..f0ad69c 100644 --- a/Modules/_io/clinic/textio.c.h +++ b/Modules/_io/clinic/textio.c.h @@ -39,11 +39,6 @@ _io_IncrementalNewlineDecoder___init__(PyObject *self, PyObject *args, PyObject goto exit; } decoder = fastargs[0]; - if (PyFloat_Check(fastargs[1])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } translate = _PyLong_AsInt(fastargs[1]); if (translate == -1 && PyErr_Occurred()) { goto exit; @@ -90,11 +85,6 @@ _io_IncrementalNewlineDecoder_decode(nldecoder_object *self, PyObject *const *ar if (!noptargs) { goto skip_optional_pos; } - if (PyFloat_Check(args[1])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } final = _PyLong_AsInt(args[1]); if (final == -1 && PyErr_Occurred()) { goto exit; @@ -266,11 +256,6 @@ _io_TextIOWrapper___init__(PyObject *self, PyObject *args, PyObject *kwargs) } } if (fastargs[4]) { - if (PyFloat_Check(fastargs[4])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } line_buffering = _PyLong_AsInt(fastargs[4]); if (line_buffering == -1 && PyErr_Occurred()) { goto exit; @@ -279,11 +264,6 @@ _io_TextIOWrapper___init__(PyObject *self, PyObject *args, PyObject *kwargs) goto skip_optional_pos; } } - if (PyFloat_Check(fastargs[5])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } write_through = _PyLong_AsInt(fastargs[5]); if (write_through == -1 && PyErr_Occurred()) { goto exit; @@ -470,11 +450,6 @@ _io_TextIOWrapper_readline(textio *self, PyObject *const *args, Py_ssize_t nargs 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]); @@ -519,11 +494,6 @@ _io_TextIOWrapper_seek(textio *self, PyObject *const *args, Py_ssize_t nargs) if (nargs < 2) { goto skip_optional; } - if (PyFloat_Check(args[1])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } whence = _PyLong_AsInt(args[1]); if (whence == -1 && PyErr_Occurred()) { goto exit; @@ -701,4 +671,4 @@ _io_TextIOWrapper_close(textio *self, PyObject *Py_UNUSED(ignored)) { return _io_TextIOWrapper_close_impl(self); } -/*[clinic end generated code: output=b1bae4f4cdf6019e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ea96ee1eb3a71f77 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/winconsoleio.c.h b/Modules/_io/clinic/winconsoleio.c.h index 3e501a5..cf6ce60 100644 --- a/Modules/_io/clinic/winconsoleio.c.h +++ b/Modules/_io/clinic/winconsoleio.c.h @@ -86,11 +86,6 @@ _io__WindowsConsoleIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) } } if (fastargs[2]) { - if (PyFloat_Check(fastargs[2])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } closefd = _PyLong_AsInt(fastargs[2]); if (closefd == -1 && PyErr_Occurred()) { goto exit; @@ -386,4 +381,4 @@ _io__WindowsConsoleIO_isatty(winconsoleio *self, PyObject *Py_UNUSED(ignored)) #ifndef _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF #define _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF #endif /* !defined(_IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF) */ -/*[clinic end generated code: output=f5b8860a658a001a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a28b3120fa53b256 input=a9049054013a1b77]*/ diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c index caf91df..7c8ba37 100644 --- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -255,12 +255,6 @@ _io_FileIO___init___impl(fileio *self, PyObject *nameobj, const char *mode, self->fd = -1; } - if (PyFloat_Check(nameobj)) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float"); - return -1; - } - fd = _PyLong_AsInt(nameobj); if (fd < 0) { if (!PyErr_Occurred()) { @@ -895,10 +889,6 @@ portable_lseek(fileio *self, PyObject *posobj, int whence, bool suppress_pipe_er pos = 0; } else { - if(PyFloat_Check(posobj)) { - PyErr_SetString(PyExc_TypeError, "an integer is required"); - return NULL; - } #if defined(HAVE_LARGEFILE_SUPPORT) pos = PyLong_AsLongLong(posobj); #else diff --git a/Modules/_io/winconsoleio.c b/Modules/_io/winconsoleio.c index a83ef37..4ccf027 100644 --- a/Modules/_io/winconsoleio.c +++ b/Modules/_io/winconsoleio.c @@ -281,12 +281,6 @@ _io__WindowsConsoleIO___init___impl(winconsoleio *self, PyObject *nameobj, self->handle = INVALID_HANDLE_VALUE; } - if (PyFloat_Check(nameobj)) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float"); - return -1; - } - fd = _PyLong_AsInt(nameobj); if (fd < 0) { if (!PyErr_Occurred()) { |