summaryrefslogtreecommitdiffstats
path: root/Modules/_tkinter.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-07-30 15:33:13 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-07-30 15:33:13 (GMT)
commit74596a887aff06d7ec45957672126881f1865cf2 (patch)
treee1d09c27b18bb00e7683df8575a7c95c0c8b0f99 /Modules/_tkinter.c
parent95a9e0bf8c2862ba3bfec4d5e35ef982521fe1e2 (diff)
downloadcpython-74596a887aff06d7ec45957672126881f1865cf2.zip
cpython-74596a887aff06d7ec45957672126881f1865cf2.tar.gz
cpython-74596a887aff06d7ec45957672126881f1865cf2.tar.bz2
Issue #21580: Now Tkinter correctly handles bytes arguments passed to Tk.
In particular this allows to initialize images from binary data.
Diffstat (limited to 'Modules/_tkinter.c')
-rw-r--r--Modules/_tkinter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index e3d3757..83161fe 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -881,8 +881,8 @@ AsObj(PyObject *value)
int overflow;
if (PyBytes_Check(value))
- return Tcl_NewStringObj(PyBytes_AS_STRING(value),
- PyBytes_GET_SIZE(value));
+ return Tcl_NewByteArrayObj((unsigned char *)PyBytes_AS_STRING(value),
+ PyBytes_GET_SIZE(value));
else if (PyBool_Check(value))
return Tcl_NewBooleanObj(PyObject_IsTrue(value));
else if (PyLong_CheckExact(value) &&