Issue #1658: dict size is changing during iteration in tkinter.BaseWidget and

tkinter.scrolledtext.ScrolledText.

Reviewed by Amaury Forgeot d'Arc
This commit is contained in:
Guilherme Polo 2008-09-04 11:21:31 +00:00
parent c96cba047b
commit b212b75c22
3 changed files with 10 additions and 10 deletions

View file

@ -1913,11 +1913,9 @@ class BaseWidget(Misc):
cnf = _cnfmerge((cnf, kw))
self.widgetName = widgetName
BaseWidget._setup(self, master, cnf)
classes = []
for k in cnf.keys():
if isinstance(k, type):
classes.append((k, cnf[k]))
del cnf[k]
classes = [(k, v) for k, v in cnf.items() if isinstance(k, type)]
for k, v in classes:
del cnf[k]
self.tk.call(
(widgetName, self._w) + extra + self._options(cnf))
for k, v in classes: