changeset 42060:93a1a4fef532

hgmanpage: use a py2 and py3 compatible iterable protocol
author Philippe Pepiot <philippe.pepiot@logilab.fr>
date Thu, 04 Apr 2019 19:08:37 +0200
parents 51df72655b1a
children f3365065ef1d
files doc/hgmanpage.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/doc/hgmanpage.py	Thu Apr 04 19:08:05 2019 +0200
+++ b/doc/hgmanpage.py	Thu Apr 04 19:08:37 2019 +0200
@@ -335,7 +335,7 @@
                 elif style.endswith('roman'):
                     self._indent = 5
 
-            def next(self):
+            def __next__(self):
                 if self._style == 'bullet':
                     return self.enum_style[self._style]
                 elif self._style == 'emdash':
@@ -353,6 +353,9 @@
                     return res.lower()
                 else:
                     return "%d." % self._cnt
+
+            next = __next__
+
             def get_width(self):
                 return self._indent
             def __repr__(self):