# HG changeset patch # User Augie Fackler # Date 2017-07-24 15:19:45 # Node ID 5ae35a1347fdf0ceee9417239c0236e8d61e62fe # Parent da7c285ec6da1cd2be0485ddb4b83b3c21c79b02 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. diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -1070,7 +1070,8 @@ class bundlepart(object): 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: