python 2.6 compatibility: preventing RuntimeError: dictionary changed size during iteration.

pull/868/head
sebres 2014-11-28 19:50:52 +01:00
parent d63b125877
commit 00c2ac4b03
1 changed files with 3 additions and 1 deletions

View File

@ -227,9 +227,11 @@ after = 1.conf
s2 = alls.get(n)
if isinstance(s2, dict):
# save previous known values, for possible using in local interpolations later:
sk = {}
for k, v in s2.iteritems():
if not k.startswith('known/'):
s2['known/'+k] = v
sk['known/'+k] = v
s2.update(sk)
# merge section
s2.update(s)
else: