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.
--- 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: