mirror of
https://github.com/python/cpython.git
synced 2025-08-29 21:25:01 +00:00
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:
parent
c96cba047b
commit
b212b75c22
3 changed files with 10 additions and 10 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue