changeset 33673:5ae35a1347fd

bundle2: look for __next__ as well as next to identify iterators In Python 3, next is called __next__ and this was failing to catch some iterators.
author Augie Fackler <augie@google.com>
date Mon, 24 Jul 2017 11:19:45 -0400
parents da7c285ec6da
children 9a323773216c
files mercurial/bundle2.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundle2.py	Mon Jul 24 11:17:36 2017 -0400
+++ b/mercurial/bundle2.py	Mon Jul 24 11:19:45 2017 -0400
@@ -1070,7 +1070,8 @@
         Exists to handle the different methods to provide data to a part."""
         # we only support fixed size data now.
         # This will be improved in the future.
-        if util.safehasattr(self.data, 'next'):
+        if (util.safehasattr(self.data, 'next')
+            or util.safehasattr(self.data, '__next__')):
             buff = util.chunkbuffer(self.data)
             chunk = buff.read(preferedchunksize)
             while chunk: