Patchwork [09,of,10,py3] bundle2: work around zip() being lazy in Python 3

login
register
mail settings
Submitter Augie Fackler
Date Aug. 1, 2017, 8:34 p.m.
Message ID <fab6234e619e0e57cec4.1501619677@augie-macbookpro2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/22616/
State Accepted
Headers show

Comments

Augie Fackler - Aug. 1, 2017, 8:34 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1500909608 14400
#      Mon Jul 24 11:20:08 2017 -0400
# Node ID fab6234e619e0e57cec4b7d0b5150bfbbede8b30
# Parent  7aac6fefd0a1a7357fb4f04b92e50131768b3f6b
bundle2: work around zip() being lazy in Python 3

Patch

diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -1227,7 +1227,7 @@  class unbundlepart(unpackermixin):
         fparamsizes = _makefpartparamsizes(mancount + advcount)
         paramsizes = self._unpackheader(fparamsizes)
         # make it a list of couple again
-        paramsizes = zip(paramsizes[::2], paramsizes[1::2])
+        paramsizes = list(zip(paramsizes[::2], paramsizes[1::2]))
         # split mandatory from advisory
         mansizes = paramsizes[:mancount]
         advsizes = paramsizes[mancount:]