diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-07-30 15:34:01 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-07-30 15:34:01 (GMT) |
commit | f44611cadfa8f4f592a2b13d0dbffa84bccc4418 (patch) | |
tree | d78adf08a5365a9a2df4bd851289310338ad3588 /Modules/_tkinter.c | |
parent | da565a790c0851650d6466cde43381e208746197 (diff) | |
parent | 74596a887aff06d7ec45957672126881f1865cf2 (diff) | |
download | cpython-f44611cadfa8f4f592a2b13d0dbffa84bccc4418.zip cpython-f44611cadfa8f4f592a2b13d0dbffa84bccc4418.tar.gz cpython-f44611cadfa8f4f592a2b13d0dbffa84bccc4418.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.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 0acded3..d2fda62 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -901,8 +901,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) && |