From: Chris Lamb Date: Fri, 30 Oct 2009 13:52:08 +0000 (+0000) Subject: Use foo.iteritems() to avoid reentrancy with foo[k]. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34c082916bb247ab93b6932fea95cf324c427b7e;p=dak Use foo.iteritems() to avoid reentrancy with foo[k]. Signed-off-by: Chris Lamb --- diff --git a/daklib/utils.py b/daklib/utils.py index 70500ad7..276ca242 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -759,8 +759,8 @@ def TemplateSubst(subst_map, filename): """ Perform a substition of template """ templatefile = open_file(filename) template = templatefile.read() - for x in subst_map.keys(): - template = template.replace(x, str(subst_map[x])) + for k, v in subst_map.iteritems(): + template = template.replace(k, str(v)) templatefile.close() return template