[elbe-devel] [PATCH 12/13] add an iter() implementation to treeutils

Torben Hohn torben.hohn at linutronix.de
Tue Dec 5 17:24:57 CET 2017


On Thu, Nov 30, 2017 at 03:15:14PM +0100, Manuel Traut wrote:
> this fixes
> 
> 00:20:44.776     for c in def_xml.node("/preseed"):
> 00:20:44.776 TypeError: iter() returned non-iterator of type 'eiter'

errm... what is the point here ?
2to3 renames next () to __next__ () and then we add a next () fallback ?

is this still supposed to work with python 2 ?
i hope that this error does not come from py3.


> 
> Signed-off-by: Manuel Traut <manut at linutronix.de>
> ---
>  elbepack/treeutils.py | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/elbepack/treeutils.py b/elbepack/treeutils.py
> index 64b04a05..c998bde9 100644
> --- a/elbepack/treeutils.py
> +++ b/elbepack/treeutils.py
> @@ -39,6 +39,9 @@ class eiter(object):
>  
>          return elem(n)
>  
> +    def next(self):
> +        return self.__next__()
> +
>  class ebase(object):
>      def __init__(self, et):
>          self.et = et
> -- 
> 2.15.1
> 
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel

-- 
Mit freundlichen Grüßen
Torben Hohn

Linutronix GmbH

Standort: Bremen

Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Firmensitz / Registered Office: D-88690 Uhldingen, Bahnhofstr. 3
Registergericht / Local District Court: Amtsgericht Freiburg i. Br.; HRB
Nr. / Trade register no.: 700 806

Geschäftsführer / Managing Directors: Heinz Egger, Thomas Gleixner

Eine Bitte von uns: Sollten Sie diese E-Mail irrtümlich erhalten haben,
benachrichtigen Sie uns in diesem Falle bitte sobald wie es Ihnen
möglich ist, durch Antwort-Mail. Vielen Dank!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.linutronix.de/pipermail/elbe-devel/attachments/20171205/1d8d3a1f/attachment.sig>


More information about the elbe-devel mailing list