Skip to content

Commit

Permalink
Avoid mutating kwargs dict while iterating.
Browse files Browse the repository at this point in the history
The 'add_with_prefix' helper may return the original dict, if no prefix
is set, which causes an error under Python3.

Closes #10.
  • Loading branch information
tseaver committed Jun 6, 2017
1 parent 3e5d096 commit 910cf61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DocumentTemplate/DT_In.py
Expand Up @@ -514,7 +514,7 @@ def renderwb(self, md):
self.start_name_re, prefix)
kw = vars.data
pkw = add_with_prefix(kw, 'sequence', prefix)
for k, v in kw.items():
for k, v in list(kw.items()):
pkw[k] = v
pkw['sequence-step-size'] = sz
pkw['sequence-step-overlap'] = overlap
Expand Down Expand Up @@ -697,7 +697,7 @@ def renderwob(self, md):
vars = sequence_variables(sequence, alt_prefix=prefix)
kw = vars.data
pkw = add_with_prefix(kw, 'sequence', prefix)
for k, v in kw.items():
for k, v in list(kw.items()):
pkw[k] = v
kw['mapping'] = mapping

Expand Down

0 comments on commit 910cf61

Please sign in to comment.