mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Issue #21580: Now Tkinter correctly handles bytes arguments passed to Tk.
In particular this allows to initialize images from binary data.
This commit is contained in:
parent
95a9e0bf8c
commit
74596a887a
4 changed files with 20 additions and 16 deletions
|
|
@ -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) &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue