diff --git a/direct/src/gui/DirectGuiBase.py b/direct/src/gui/DirectGuiBase.py index 633b9615c0..95ad70158a 100644 --- a/direct/src/gui/DirectGuiBase.py +++ b/direct/src/gui/DirectGuiBase.py @@ -505,7 +505,7 @@ class DirectGuiBase(DirectObject.DirectObject): # with corresponding keys beginning with *component*. alias = alias + '_' aliasLen = len(alias) - for option in keywords: + for option in keywords.copy(): if len(option) > aliasLen and option[:aliasLen] == alias: newkey = component + '_' + option[aliasLen:] keywords[newkey] = keywords[option] @@ -537,7 +537,7 @@ class DirectGuiBase(DirectObject.DirectObject): # specific than the group arguments, above; we walk through # the list afterwards so they will override. - for option in keywords: + for option in keywords.copy(): if len(option) > nameLen and option[:nameLen] == componentPrefix: # The keyword argument refers to this component, so add # this to the options to use when constructing the widget.