Patchwork D1480: py3: define __next__ in patch.py

login
register
mail settings
Submitter phabricator
Date Nov. 21, 2017, 7:53 a.m.
Message ID <differential-rev-PHID-DREV-zekfwqpzimh5buifiimx-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/25710/
State Superseded
Headers show

Comments

phabricator - Nov. 21, 2017, 7:53 a.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This needed to appease Python 3's iterator protocol.
  
  This is crasher #5 in Python 3.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/patch.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/patch.py b/mercurial/patch.py
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -149,6 +149,8 @@ 
                 raise StopIteration
             return l
 
+        __next__ = next
+
     inheader = False
     cur = []