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

Torben Hohn torben.hohn at linutronix.de
Fri Dec 15 17:46:19 CET 2017


On Mon, Dec 11, 2017 at 10:11:09AM +0100, Manuel Traut wrote:
> PEP 3114 -- Renaming iterator.next() to iterator.__next__()
> 
> Signed-off-by: Manuel Traut <manut at linutronix.de>

Reviewed-by: Torben Hohn <torben.hohn 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
> 
> 
> _______________________________________________
> 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/20171215/9fbeb12f/attachment.sig>


More information about the elbe-devel mailing list