Skip to content
Snippets Groups Projects
Commit c0277161 authored by Gregory Szorc's avatar Gregory Szorc
Browse files

py3: avoid changing dictionary during iteration

dict.items() and friends are iterators/views in Python 3. You
aren't allowed to mutate the underlying dictionary when iterating
on these views. So iterate over a copy of things.

Differential Revision: https://phab.mercurial-scm.org/D2164
parent b587a889
No related branches found
No related tags found
No related merge requests found
......@@ -123,7 +123,7 @@
t[k] = v
# remove criss-crossed copies
for k, v in t.items():
for k, v in list(t.items()):
if k in src and v in dst:
del t[k]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment