[elbe-devel] [PATCH 15/25] py3: convert next

Manuel Traut manut at linutronix.de
Mon Dec 11 10:11:09 CET 2017


PEP 3114 -- Renaming iterator.next() to iterator.__next__()

Signed-off-by: Manuel Traut <manut at linutronix.de>
---
 elbepack/treeutils.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/elbepack/treeutils.py b/elbepack/treeutils.py
index 8efc401c..65386a68 100644
--- a/elbepack/treeutils.py
+++ b/elbepack/treeutils.py
@@ -16,6 +16,8 @@
 # You should have received a copy of the GNU General Public License
 # along with ELBE.  If not, see <http://www.gnu.org/licenses/>.
 
+from __future__ import print_function
+
 from lxml.etree import ElementTree, SubElement, Element
 from lxml.etree import XMLParser,parse
 import copy
@@ -29,9 +31,9 @@ class eiter(object):
     def __iter__(self):
         return self
 
-    def next(self):
+    def __next__(self):
         while True:
-            n = self.it.next()
+            n = next(self.it)
             # A Comment has a callable tag
             # A better way for this predicate would be nice
             if not callable(n.tag):
-- 
2.15.1




More information about the elbe-devel mailing list