diff options
author | Fred Drake <fdrake@acm.org> | 2001-01-08 04:04:34 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-01-08 04:04:34 (GMT) |
commit | daa823ad9a2d8c76ddc152b1ccae26251500efda (patch) | |
tree | 12e9c3d15dcb5541b3efdc6f72b22899c1fa269f /Lib/xml/dom | |
parent | 1c73323d6fb1807123ccbf56019d70d4832f9590 (diff) | |
download | cpython-daa823ad9a2d8c76ddc152b1ccae26251500efda.zip cpython-daa823ad9a2d8c76ddc152b1ccae26251500efda.tar.gz cpython-daa823ad9a2d8c76ddc152b1ccae26251500efda.tar.bz2 |
Text.__init__(): Make sure the data parameter is a string (8-bit or
Unicode); raise TypeError if not.
This closes SF bug #126866.
Diffstat (limited to 'Lib/xml/dom')
-rw-r--r-- | Lib/xml/dom/minidom.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py index 74c9664..65af4c7 100644 --- a/Lib/xml/dom/minidom.py +++ b/Lib/xml/dom/minidom.py @@ -553,6 +553,8 @@ class Text(Node): childNodeTypes = () def __init__(self, data): + if type(data) not in _StringTypes: + raise TypeError, "node contents must be a string" Node.__init__(self) self.data = self.nodeValue = data |