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, 3 insertions, 1 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 5095060..6e595cc 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -2750,7 +2750,9 @@ Tkinter_Flatten(PyObject* self, PyObject* args)
return NULL;
context.maxsize = PySequence_Size(item);
- if (context.maxsize <= 0)
+ if (context.maxsize < 0)
+ return NULL;
+ if (context.maxsize == 0)
return PyTuple_New(0);
context.tuple = PyTuple_New(context.maxsize);