summaryrefslogtreecommitdiffstats
path: root/Modules/_io/_iomodule.c
diff options
context:
space:
mode:
authorJeroen Demeyer <J.Demeyer@UGent.be>2019-07-08 08:19:25 (GMT)
committerInada Naoki <songofacandy@gmail.com>2019-07-08 08:19:25 (GMT)
commit762f93ff2efd6b7ef0177cad57939c0ab2002eac (patch)
tree4811b08fa9342c3b2575de7e7c1030d1d5eea8a0 /Modules/_io/_iomodule.c
parent38f44b4a4adc37e8f5f8971917d8b3145f351a56 (diff)
downloadcpython-762f93ff2efd6b7ef0177cad57939c0ab2002eac.zip
cpython-762f93ff2efd6b7ef0177cad57939c0ab2002eac.tar.gz
cpython-762f93ff2efd6b7ef0177cad57939c0ab2002eac.tar.bz2
bpo-37337: Add _PyObject_CallMethodNoArgs() (GH-14267)
Diffstat (limited to 'Modules/_io/_iomodule.c')
-rw-r--r--Modules/_io/_iomodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c
index 5c2f019..96426e0 100644
--- a/Modules/_io/_iomodule.c
+++ b/Modules/_io/_iomodule.c
@@ -400,7 +400,7 @@ _io_open_impl(PyObject *module, PyObject *file, const char *mode,
/* buffering */
if (buffering < 0) {
- PyObject *res = _PyObject_CallMethodId(raw, &PyId_isatty, NULL);
+ PyObject *res = _PyObject_CallMethodIdNoArgs(raw, &PyId_isatty);
if (res == NULL)
goto error;
isatty = PyLong_AsLong(res);
@@ -494,7 +494,7 @@ _io_open_impl(PyObject *module, PyObject *file, const char *mode,
if (result != NULL) {
PyObject *exc, *val, *tb, *close_result;
PyErr_Fetch(&exc, &val, &tb);
- close_result = _PyObject_CallMethodId(result, &PyId_close, NULL);
+ close_result = _PyObject_CallMethodIdNoArgs(result, &PyId_close);
_PyErr_ChainExceptions(exc, val, tb);
Py_XDECREF(close_result);
Py_DECREF(result);