Use PyObject_CallOneArg instead of PyObject_CallFunctionObjArgs for perf

This commit is contained in:
rdb 2026-01-07 19:34:49 +01:00
parent f958fdced3
commit 0bb8a4519a
2 changed files with 2 additions and 2 deletions

View File

@ -67,7 +67,7 @@ __init__(PyObject *path) {
return;
}
PyObject *path_str = PyObject_CallFunctionObjArgs(fspath, path, nullptr);
PyObject *path_str = PyObject_CallOneArg(fspath, path);
Py_DECREF(fspath);
if (path_str == nullptr) {
return;

View File

@ -652,7 +652,7 @@ do_python_task() {
PyObject *func = PyObject_GetAttrString(_generator, "throw");
if (func != nullptr) {
PyObject *exc = PyObject_CallNoArgs(exc_type);
result = PyObject_CallFunctionObjArgs(func, exc, nullptr);
result = PyObject_CallOneArg(func, exc);
Py_DECREF(exc);
Py_DECREF(func);
} else {