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

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Sun Feb 18 07:46:54 EST 2018


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

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



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


More information about the Mercurial-devel mailing list