Skip to content

Commit 8d0f620

Browse files
Use specialized functions intead of Py_BuildValue() in _tkinter.
1 parent 645058d commit 8d0f620

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎Modules/_tkinter.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2092,7 +2092,7 @@ _tkinter_tkapp_exprlong_impl(TkappObject *self, const char *s)
20922092
if (retval == TCL_ERROR)
20932093
res = Tkinter_Error((PyObject *)self);
20942094
else
2095-
res = Py_BuildValue("l", v);
2095+
res = PyLong_FromLong(v);
20962096
LEAVE_OVERLAP_TCL
20972097
return res;
20982098
}
@@ -2123,7 +2123,7 @@ _tkinter_tkapp_exprdouble_impl(TkappObject *self, const char *s)
21232123
if (retval == TCL_ERROR)
21242124
res = Tkinter_Error((PyObject *)self);
21252125
else
2126-
res = Py_BuildValue("d", v);
2126+
res = PyFloat_FromDouble(v);
21272127
LEAVE_OVERLAP_TCL
21282128
return res;
21292129
}
@@ -2152,7 +2152,7 @@ _tkinter_tkapp_exprboolean_impl(TkappObject *self, const char *s)
21522152
if (retval == TCL_ERROR)
21532153
res = Tkinter_Error((PyObject *)self);
21542154
else
2155-
res = Py_BuildValue("i", v);
2155+
res = PyLong_FromLong(v);
21562156
LEAVE_OVERLAP_TCL
21572157
return res;
21582158
}
@@ -2891,7 +2891,7 @@ _tkinter_tkapp_dooneevent_impl(TkappObject *self, int flags)
28912891
ENTER_TCL
28922892
rv = Tcl_DoOneEvent(flags);
28932893
LEAVE_TCL
2894-
return Py_BuildValue("i", rv);
2894+
return PyLong_FromLong(rv);
28952895
}
28962896

28972897
/*[clinic input]

0 commit comments

Comments
 (0)