Patchwork D2304: webcommands: unpack contents of length-1 dict portably

login
register
mail settings
Submitter phabricator
Date Feb. 18, 2018, 12:46 p.m.
Message ID <0561258e6267020657954e201a0df381@localhost.localdomain>
Download mbox | patch
Permalink /patch/28065/
State Not Applicable
Headers show

Comments

phabricator - Feb. 18, 2018, 12:46 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGa748a5d1d7c3: webcommands: unpack contents of length-1 dict portably (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2304?vs=5822&id=5841

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

AFFECTED FILES
  mercurial/hgweb/webcommands.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -542,7 +542,7 @@ 
             emptydirs = []
             h = dirs[d]
             while isinstance(h, dict) and len(h) == 1:
-                k, v = h.items()[0]
+                k, v = next(iter(h.items()))
                 if v:
                     emptydirs.append(k)
                 h = v