Patchwork D3323: py3: iterate over a copy of dict while changing it

login
register
mail settings
Submitter phabricator
Date April 13, 2018, 8:48 p.m.
Message ID <differential-rev-PHID-DREV-i7o4hmb5sfa3edvtmaxj-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/30885/
State Superseded
Headers show

Comments

phabricator - April 13, 2018, 8:48 p.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3323

AFFECTED FILES
  mercurial/color.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel, spectral

Patch

diff --git a/mercurial/color.py b/mercurial/color.py
--- a/mercurial/color.py
+++ b/mercurial/color.py
@@ -168,7 +168,7 @@ 
         ui._terminfoparams.clear()
         return
 
-    for key, (b, e, c) in ui._terminfoparams.items():
+    for key, (b, e, c) in ui._terminfoparams.copy().items():
         if not b:
             continue
         if not c and not curses.tigetstr(e):