summaryrefslogtreecommitdiffstats
path: root/Modules/_tkinter.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_tkinter.c')
-rw-r--r--Modules/_tkinter.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index a8e6d98..02fcb81 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -906,6 +906,8 @@ AsObj(PyObject *value)
Py_ssize_t size, i;
size = PySequence_Fast_GET_SIZE(value);
+ if (size == 0)
+ return Tcl_NewListObj(0, NULL);
if (!CHECK_SIZE(size, sizeof(Tcl_Obj *))) {
PyErr_SetString(PyExc_OverflowError,
PyTuple_Check(value) ? "tuple is too long" :
@@ -936,6 +938,8 @@ AsObj(PyObject *value)
inbuf = PyUnicode_DATA(value);
size = PyUnicode_GET_LENGTH(value);
+ if (size == 0)
+ return Tcl_NewUnicodeObj((const void *)"", 0);
if (!CHECK_SIZE(size, sizeof(Tcl_UniChar))) {
PyErr_SetString(PyExc_OverflowError, "string is too long");
return NULL;