diff options
author | Petr Viktorin <encukou@gmail.com> | 2020-02-11 16:46:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-11 16:46:57 (GMT) |
commit | ffd9753a944916ced659b2c77aebe66a6c9fbab5 (patch) | |
tree | f3469bdca81c102afa811a39dd3eaa9643287e93 /Modules/_io/iobase.c | |
parent | f3e7ea5b8c220cd63101e419d529c8563f9c6115 (diff) | |
download | cpython-ffd9753a944916ced659b2c77aebe66a6c9fbab5.zip cpython-ffd9753a944916ced659b2c77aebe66a6c9fbab5.tar.gz cpython-ffd9753a944916ced659b2c77aebe66a6c9fbab5.tar.bz2 |
bpo-39245: Switch to public API for Vectorcall (GH-18460)
The bulk of this patch was generated automatically with:
for name in \
PyObject_Vectorcall \
Py_TPFLAGS_HAVE_VECTORCALL \
PyObject_VectorcallMethod \
PyVectorcall_Function \
PyObject_CallOneArg \
PyObject_CallMethodNoArgs \
PyObject_CallMethodOneArg \
;
do
echo $name
git grep -lwz _$name | xargs -0 sed -i "s/\b_$name\b/$name/g"
done
old=_PyObject_FastCallDict
new=PyObject_VectorcallDict
git grep -lwz $old | xargs -0 sed -i "s/\b$old\b/$new/g"
and then cleaned up:
- Revert changes to in docs & news
- Revert changes to backcompat defines in headers
- Nudge misaligned comments
Diffstat (limited to 'Modules/_io/iobase.c')
-rw-r--r-- | Modules/_io/iobase.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c index d51fc94..1ff3564 100644 --- a/Modules/_io/iobase.c +++ b/Modules/_io/iobase.c @@ -235,7 +235,7 @@ _io__IOBase_close_impl(PyObject *self) Py_RETURN_NONE; } - res = _PyObject_CallMethodNoArgs(self, _PyIO_str_flush); + res = PyObject_CallMethodNoArgs(self, _PyIO_str_flush); PyErr_Fetch(&exc, &val, &tb); rc = _PyObject_SetAttrId(self, &PyId___IOBase_closed, Py_True); @@ -281,7 +281,7 @@ iobase_finalize(PyObject *self) finalization process. */ if (_PyObject_SetAttrId(self, &PyId__finalizing, Py_True)) PyErr_Clear(); - res = _PyObject_CallMethodNoArgs((PyObject *)self, _PyIO_str_close); + res = PyObject_CallMethodNoArgs((PyObject *)self, _PyIO_str_close); /* Silencing I/O errors is bad, but printing spurious tracebacks is equally as bad, and potentially more frequent (because of shutdown issues). */ @@ -382,7 +382,7 @@ _io__IOBase_seekable_impl(PyObject *self) PyObject * _PyIOBase_check_seekable(PyObject *self, PyObject *args) { - PyObject *res = _PyObject_CallMethodNoArgs(self, _PyIO_str_seekable); + PyObject *res = PyObject_CallMethodNoArgs(self, _PyIO_str_seekable); if (res == NULL) return NULL; if (res != Py_True) { @@ -415,7 +415,7 @@ _io__IOBase_readable_impl(PyObject *self) PyObject * _PyIOBase_check_readable(PyObject *self, PyObject *args) { - PyObject *res = _PyObject_CallMethodNoArgs(self, _PyIO_str_readable); + PyObject *res = PyObject_CallMethodNoArgs(self, _PyIO_str_readable); if (res == NULL) return NULL; if (res != Py_True) { @@ -448,7 +448,7 @@ _io__IOBase_writable_impl(PyObject *self) PyObject * _PyIOBase_check_writable(PyObject *self, PyObject *args) { - PyObject *res = _PyObject_CallMethodNoArgs(self, _PyIO_str_writable); + PyObject *res = PyObject_CallMethodNoArgs(self, _PyIO_str_writable); if (res == NULL) return NULL; if (res != Py_True) { @@ -477,7 +477,7 @@ iobase_enter(PyObject *self, PyObject *args) static PyObject * iobase_exit(PyObject *self, PyObject *args) { - return _PyObject_CallMethodNoArgs(self, _PyIO_str_close); + return PyObject_CallMethodNoArgs(self, _PyIO_str_close); } /* Lower-level APIs */ @@ -556,7 +556,7 @@ _io__IOBase_readline_impl(PyObject *self, Py_ssize_t limit) PyObject *b; if (peek != NULL) { - PyObject *readahead = _PyObject_CallOneArg(peek, _PyLong_One); + PyObject *readahead = PyObject_CallOneArg(peek, _PyLong_One); if (readahead == NULL) { /* NOTE: PyErr_SetFromErrno() calls PyErr_CheckSignals() when EINTR occurs so we needn't do it ourselves. */ @@ -655,7 +655,7 @@ iobase_iter(PyObject *self) static PyObject * iobase_iternext(PyObject *self) { - PyObject *line = _PyObject_CallMethodNoArgs(self, _PyIO_str_readline); + PyObject *line = PyObject_CallMethodNoArgs(self, _PyIO_str_readline); if (line == NULL) return NULL; |