From 9b2cbb3b3c2f42a678dc81bddcfa239f7b9d1492 Mon Sep 17 00:00:00 2001 From: "R. Tyler Ballance" Date: Sat, 26 Dec 2009 22:15:21 -0800 Subject: Refactor run_setup() to prevent resizing the dict during iteration --- SetupTools.py | 9 +++++++-- 1 file 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 = { -- cgit v1.2.1