提交 34c08291 编写于 作者: C Chris Lamb

Use foo.iteritems() to avoid reentrancy with foo[k].

Signed-off-by: NChris Lamb <lamby@debian.org>
上级 f172f9c5
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册