GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [3.14] gh-156635: Fix the exceptions in the xml.dom documentation (GH… · python/cpython@0ee064f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Doc/library
    • xml.dom.minidom.rst
    • xml.dom.rst
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Doc/library/xml.dom.minidom.rst‎

Copy file name to clipboardExpand all lines: Doc/library/xml.dom.minidom.rst
+5Lines changed: 5 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,11 @@ rules apply:
268268
* :attr:`~xml.dom.Document.strictErrorChecking` and
269269
:attr:`~xml.dom.Attr.specified` are always ``False``.
270270

271+
* :meth:`~xml.dom.Element.removeAttribute` and
272+
:meth:`~xml.dom.Element.removeAttributeNS` raise
273+
:exc:`~xml.dom.NotFoundErr` if there is no matching attribute,
274+
while the DOM specifies that this has no effect.
275+
271276
The following interfaces have no implementation in :mod:`!xml.dom.minidom`:
272277

273278
* :class:`DOMTimeStamp`
Collapse file

‎Doc/library/xml.dom.rst‎

Copy file name to clipboardExpand all lines: Doc/library/xml.dom.rst
+5-7Lines changed: 5 additions & 7 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -464,23 +464,23 @@ for each node type are:
464464
.. method:: Node.insertBefore(newChild, refChild)
465465

466466
Insert a new child node before an existing child. It must be the case that
467-
*refChild* is a child of this node; if not, :exc:`ValueError` is raised.
467+
*refChild* is a child of this node; if not, :exc:`NotFoundErr` is raised.
468468
*newChild* is returned. If *refChild* is ``None``, it inserts *newChild* at the
469469
end of the children's list.
470470

471471

472472
.. method:: Node.removeChild(oldChild)
473473

474474
Remove a child node. *oldChild* must be a child of this node; if not,
475-
:exc:`ValueError` is raised. *oldChild* is returned on success. If *oldChild*
475+
:exc:`NotFoundErr` is raised. *oldChild* is returned on success. If *oldChild*
476476
will not be used further, its :meth:`~xml.dom.minidom.Node.unlink` method
477477
should be called.
478478

479479

480480
.. method:: Node.replaceChild(newChild, oldChild)
481481

482482
Replace an existing node with a new node. It must be the case that *oldChild*
483-
is a child of this node; if not, :exc:`ValueError` is raised.
483+
is a child of this node; if not, :exc:`NotFoundErr` is raised.
484484

485485

486486
.. method:: Node.normalize()
@@ -829,8 +829,7 @@ of that class.
829829

830830
.. method:: Element.removeAttribute(name)
831831

832-
Remove an attribute by name. If there is no matching attribute, a
833-
:exc:`NotFoundErr` is raised.
832+
Remove an attribute by name.
834833

835834

836835
.. method:: Element.removeAttributeNode(oldAttr)
@@ -841,8 +840,7 @@ of that class.
841840

842841
.. method:: Element.removeAttributeNS(namespaceURI, localName)
843842

844-
Remove an attribute by name. Note that it uses a localName, not a qname. No
845-
exception is raised if there is no matching attribute.
843+
Remove an attribute by name. Note that it uses a localName, not a qname.
846844

847845

848846
.. method:: Element.setAttribute(name, value)

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.