Permalink
Browse files

Refactor run_setup() to prevent resizing the dict during iteration

  • Loading branch information...
1 parent ebf6146 commit 9b2cbb3b3c2f42a678dc81bddcfa239f7b9d1492 @rtyler rtyler committed Dec 27, 2009
Showing with 7 additions and 2 deletions.
  1. +7 −2 SetupTools.py
View
@@ -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 = {

0 comments on commit 9b2cbb3

Please sign in to comment.