summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorR. Tyler Ballance <tyler@monkeypox.org>2009-12-26 22:15:21 -0800
committerR. Tyler Ballance <tyler@monkeypox.org>2009-12-26 22:22:16 -0800
commit9b2cbb3b3c2f42a678dc81bddcfa239f7b9d1492 (patch)
treef34e20909a3a410856d3316d73b35e8f13f1433b
parentebf61469152fb0c8eca87ad50abee6a4e5b970ae (diff)
downloadpython-cheetah-9b2cbb3b3c2f42a678dc81bddcfa239f7b9d1492.tar.gz
Refactor run_setup() to prevent resizing the dict during iteration
-rw-r--r--SetupTools.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/SetupTools.py b/SetupTools.py
index 788f81b..c831d42 100644
--- a/SetupTools.py
+++ b/SetupTools.py
@@ -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 = {