[Python-checkins] cpython: Use specialized functions intead of Py_BuildValue() in _tkinter.

serhiy.storchaka python-checkins at python.org
Wed May 6 13:19:41 CEST 2015


https://hg.python.org/cpython/rev/8bac00eadfda
changeset:   95896:8bac00eadfda
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Wed May 06 14:19:22 2015 +0300
summary:
  Use specialized functions intead of Py_BuildValue() in _tkinter.

files:
  Modules/_tkinter.c |  8 ++++----
  1 files changed, 4 insertions(+), 4 deletions(-)


diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -2092,7 +2092,7 @@
     if (retval == TCL_ERROR)
         res = Tkinter_Error((PyObject *)self);
     else
-        res = Py_BuildValue("l", v);
+        res = PyLong_FromLong(v);
     LEAVE_OVERLAP_TCL
     return res;
 }
@@ -2123,7 +2123,7 @@
     if (retval == TCL_ERROR)
         res = Tkinter_Error((PyObject *)self);
     else
-        res = Py_BuildValue("d", v);
+        res = PyFloat_FromDouble(v);
     LEAVE_OVERLAP_TCL
     return res;
 }
@@ -2152,7 +2152,7 @@
     if (retval == TCL_ERROR)
         res = Tkinter_Error((PyObject *)self);
     else
-        res = Py_BuildValue("i", v);
+        res = PyLong_FromLong(v);
     LEAVE_OVERLAP_TCL
     return res;
 }
@@ -2891,7 +2891,7 @@
     ENTER_TCL
     rv = Tcl_DoOneEvent(flags);
     LEAVE_TCL
-    return Py_BuildValue("i", rv);
+    return PyLong_FromLong(rv);
 }
 
 /*[clinic input]

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list