Skip to content

Commit

Permalink
Refactor run_setup() to prevent resizing the dict during iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
R. Tyler Ballance committed Dec 27, 2009
1 parent ebf6146 commit 9b2cbb3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions SetupTools.py
Expand Up @@ -134,11 +134,16 @@ def run_setup(configurations):
"""
# Build parameter dictionary
kws = {}
newkws = {}
for configuration in configurations:
kws.update(vars(configuration))
for name, value in kws.items():
if name[:1] == '_' or not isinstance(value, (basestring, list, tuple, dict, int)):
del kws[name]
if name[:1] == '_':
continue
if not isinstance(value, (basestring, list, tuple, dict, int)):
continue
newkws[name] = value
kws = newkws

# Add setup extensions
cmdclasses = {
Expand Down

0 comments on commit 9b2cbb3

Please sign in to comment.