]> err.no Git - dak/commitdiff
Use foo.iteritems() to avoid reentrancy with foo[k].
authorChris Lamb <lamby@debian.org>
Fri, 30 Oct 2009 13:52:08 +0000 (13:52 +0000)
committerChris Lamb <lamby@debian.org>
Fri, 30 Oct 2009 14:29:58 +0000 (14:29 +0000)
Signed-off-by: Chris Lamb <lamby@debian.org>
daklib/utils.py

index 70500ad7aa814de5d6d6656f4b2a20fe04daf278..276ca2428fbfbf1e225785e99947418ce9469535 100755 (executable)
@@ -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