diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2013-09-23 23:20:07 +0300 |
|---|---|---|
| committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-09-23 23:20:07 +0300 |
| commit | 369606df2f9235e8e9bce1feabf1ac48c889f8d5 (patch) | |
| tree | 14947a537f0f6f04f94f9673398d3f1d7a6b024a /Modules/_tkinter.c | |
| parent | 587b30571d8dff63f602ac303659988d7c2ddea3 (diff) | |
| download | cpython-git-369606df2f9235e8e9bce1feabf1ac48c889f8d5.tar.gz | |
Issue #19028: Fixed tkinter.Tkapp.merge() for non-string arguments.
Diffstat (limited to 'Modules/_tkinter.c')
| -rw-r--r-- | Modules/_tkinter.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 1350ff5cb9..ecad541b95 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -331,17 +331,8 @@ AsString(PyObject *value, PyObject *tmp) { if (PyBytes_Check(value)) return PyBytes_AsString(value); - else if (PyUnicode_Check(value)) { - PyObject *v = PyUnicode_AsUTF8String(value); - if (v == NULL) - return NULL; - if (PyList_Append(tmp, v) != 0) { - Py_DECREF(v); - return NULL; - } - Py_DECREF(v); - return PyBytes_AsString(v); - } + else if (PyUnicode_Check(value)) + return PyUnicode_AsUTF8(value); else { PyObject *v = PyObject_Str(value); if (v == NULL) @@ -351,7 +342,7 @@ AsString(PyObject *value, PyObject *tmp) return NULL; } Py_DECREF(v); - return PyBytes_AsString(v); + return PyUnicode_AsUTF8(v); } } |
