~ubuntu-branches/ubuntu/wily/libxml2/wily-proposed

« back to all changes in this revision

Viewing changes to python/libxml2.py

  • Committer: Package Import Robot
  • Author(s): Aron Xu
  • Date: 2014-10-26 07:04:50 UTC
  • mfrom: (43.2.7 sid)
  • Revision ID: package-import@ubuntu.com-20141026070450-rmcqvcqn8peeuebs
Tags: 2.9.2+dfsg1-1
* New upstream release (Closes: #765722, CVE-2014-3660)
* Remove no-longer-needed upstream patches
* Update distro patch
* Std-ver: 3.9.5 -> 3.9.6, no change.

Show diffs side-by-side

added added

removed removed

Lines of Context:
530
530
        self.parents = []
531
531
    def __iter__(self):
532
532
        return self
533
 
    def next(self):
 
533
    def __next__(self):
534
534
        while 1:
535
535
            if self.node:
536
536
                ret = self.node
542
542
            except IndexError:
543
543
                raise StopIteration
544
544
            self.node = parent.next
 
545
    next = __next__
545
546
 
546
547
#
547
548
# implements the breadth-first iterator for libxml2 DOM tree
552
553
        self.parents = []
553
554
    def __iter__(self):
554
555
        return self
555
 
    def next(self):
 
556
    def __next__(self):
556
557
        while 1:
557
558
            if self.node:
558
559
                ret = self.node
564
565
            except IndexError:
565
566
                raise StopIteration
566
567
            self.node = parent.children
 
568
    next = __next__
567
569
 
568
570
#
569
571
# converters to present a nicer view of the XPath returns
3363
3365
    def newNs(self, href, prefix):
3364
3366
        """Creation of a new Namespace. This function will refuse to
3365
3367
          create a namespace with a similar prefix than an existing
3366
 
          one present on this node. We use href==None in the case of
3367
 
           an element creation where the namespace was not defined. """
 
3368
          one present on this node. Note that for a default
 
3369
          namespace, @prefix should be None.  We use href==None in
 
3370
          the case of an element creation where the namespace was not
 
3371
           defined. """
3368
3372
        ret = libxml2mod.xmlNewNs(self._o, href, prefix)
3369
3373
        if ret is None:raise treeError('xmlNewNs() failed')
3370
3374
        __tmp = xmlNs(_obj=ret)