Skip to content

Commit 0970bc3

Browse files
committed
Do the same for Attr
1 parent 008c30b commit 0970bc3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Lib/xml/dom/minidom.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ class Attr(Node):
364364
def __init__(self, qName, namespaceURI=EMPTY_NAMESPACE, localName=None,
365365
prefix=None):
366366
self.ownerElement = None
367+
self.ownerDocument = None
367368
self._name = qName
368369
self.namespaceURI = namespaceURI
369370
self._prefix = prefix
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Add the *ownerDocument* attribute to :mod:`xml.dom.minidom` elements created
2-
by directly instantiating the Element class. Note that this way of creating
3-
Element instances is not supported; creator functions like
1+
Add the *ownerDocument* attribute to :mod:`xml.dom.minidom` elements and attributes
2+
created by directly instantiating the ``Element`` or ``Attr`` class. Note that
3+
this way of creating nodes is not supported; creator functions like
44
:py:meth:`xml.dom.Document.documentElement` should be used instead.

0 commit comments

Comments
 (0)