summaryrefslogtreecommitdiff
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-08-20 01:24:22 +0200
committerVictor Stinner <victor.stinner@gmail.com>2016-08-20 01:24:22 +0200
commitb0d6074700270d6c57fac1354c7b701210f2bbea (patch)
tree7f28e89e0199b6babfc0184a8a1c8ef52dceb3ea /Python/sysmodule.c
parentf1390f308e25c22f553ef9c720842b2c537d831a (diff)
downloadcpython-b0d6074700270d6c57fac1354c7b701210f2bbea.tar.gz
sys_pyfile_write_unicode() now uses fast call
Issue #27128.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 74b8560ae8..be8e164bba 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -2112,7 +2112,7 @@ PySys_SetArgv(int argc, wchar_t **argv)
static int
sys_pyfile_write_unicode(PyObject *unicode, PyObject *file)
{
- PyObject *writer = NULL, *args = NULL, *result = NULL;
+ PyObject *writer = NULL, *result = NULL;
int err;
if (file == NULL)
@@ -2122,11 +2122,7 @@ sys_pyfile_write_unicode(PyObject *unicode, PyObject *file)
if (writer == NULL)
goto error;
- args = PyTuple_Pack(1, unicode);
- if (args == NULL)
- goto error;
-
- result = PyEval_CallObject(writer, args);
+ result = _PyObject_FastCall(writer, &unicode, 1, NULL);
if (result == NULL) {
goto error;
} else {
@@ -2138,7 +2134,6 @@ error:
err = -1;
finally:
Py_XDECREF(writer);
- Py_XDECREF(args);
Py_XDECREF(result);
return err;
}