summaryrefslogtreecommitdiffstats
path: root/Python/_warnings.c
diff options
context:
space:
mode:
authorJeroen Demeyer <J.Demeyer@UGent.be>2019-07-04 10:31:34 (GMT)
committerInada Naoki <songofacandy@gmail.com>2019-07-04 10:31:34 (GMT)
commit196a530e00d88a138973bf9182e013937e293f97 (patch)
tree35443abb5aa148b459f68ae43a18cdbb0627ba76 /Python/_warnings.c
parent9d40554e0da09a44a8547f3f3a2b9dedfeaf7928 (diff)
downloadcpython-196a530e00d88a138973bf9182e013937e293f97.zip
cpython-196a530e00d88a138973bf9182e013937e293f97.tar.gz
cpython-196a530e00d88a138973bf9182e013937e293f97.tar.bz2
bpo-37483: add _PyObject_CallOneArg() function (#14558)
Diffstat (limited to 'Python/_warnings.c')
-rw-r--r--Python/_warnings.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c
index 0b19258..b1762e6 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -590,7 +590,7 @@ call_show_warning(PyObject *category, PyObject *text, PyObject *message,
if (msg == NULL)
goto error;
- res = PyObject_CallFunctionObjArgs(show_fn, msg, NULL);
+ res = _PyObject_CallOneArg(show_fn, msg);
Py_DECREF(show_fn);
Py_DECREF(msg);
@@ -651,7 +651,7 @@ warn_explicit(PyObject *category, PyObject *message,
}
else {
text = message;
- message = PyObject_CallFunctionObjArgs(category, message, NULL);
+ message = _PyObject_CallOneArg(category, message);
if (message == NULL)
goto cleanup;
}
@@ -996,7 +996,7 @@ get_source_line(PyObject *module_globals, int lineno)
return NULL;
}
/* Call get_source() to get the source code. */
- source = PyObject_CallFunctionObjArgs(get_source, module_name, NULL);
+ source = _PyObject_CallOneArg(get_source, module_name);
Py_DECREF(get_source);
Py_DECREF(module_name);
if (!source) {
@@ -1283,7 +1283,7 @@ _PyErr_WarnUnawaitedCoroutine(PyObject *coro)
int warned = 0;
PyObject *fn = get_warnings_attr(&PyId__warn_unawaited_coroutine, 1);
if (fn) {
- PyObject *res = PyObject_CallFunctionObjArgs(fn, coro, NULL);
+ PyObject *res = _PyObject_CallOneArg(fn, coro);
Py_DECREF(fn);
if (res || PyErr_ExceptionMatches(PyExc_RuntimeWarning)) {
warned = 1;