bundle2: update check for a generator to work on Python 3
authorAugie Fackler <augie@google.com>
Mon, 18 Sep 2017 13:36:05 -0400
changeset 34278 ea7588c11c36
parent 34277 a48b3db0baba
child 34279 047f2af8ceb0
bundle2: update check for a generator to work on Python 3
mercurial/bundle2.py
--- a/mercurial/bundle2.py	Mon Sep 18 13:35:43 2017 -0400
+++ b/mercurial/bundle2.py	Mon Sep 18 13:36:05 2017 -0400
@@ -1019,7 +1019,8 @@
                 msg.append(')')
             if not self.data:
                 msg.append(' empty payload')
-            elif util.safehasattr(self.data, 'next'):
+            elif (util.safehasattr(self.data, 'next')
+                  or util.safehasattr(self.data, '__next__')):
                 msg.append(' streamed payload')
             else:
                 msg.append(' %i bytes payload' % len(self.data))