summaryrefslogtreecommitdiffstats
path: root/Lib/xml/dom
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2002-05-31 20:46:39 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2002-05-31 20:46:39 (GMT)
commitab199622905b2621b2ad9abcb324fb5f124cc12f (patch)
treeb9f78d40a05178f73cc76669fffc1bc7707d2d58 /Lib/xml/dom
parent3f8dae73c74d2a0a0aa55c1669f73e0d6ab827e1 (diff)
downloadcpython-ab199622905b2621b2ad9abcb324fb5f124cc12f.zip
cpython-ab199622905b2621b2ad9abcb324fb5f124cc12f.tar.gz
cpython-ab199622905b2621b2ad9abcb324fb5f124cc12f.tar.bz2
Use more string methods, remove import string
Diffstat (limited to 'Lib/xml/dom')
-rw-r--r--Lib/xml/dom/minidom.py17
1 files changed, 6 insertions, 11 deletions
diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py
index 085f0eb..cb2c4d2 100644
--- a/Lib/xml/dom/minidom.py
+++ b/Lib/xml/dom/minidom.py
@@ -14,10 +14,6 @@ Todo:
* SAX 2 namespaces
"""
-import string
-_string = string
-del string
-
from xml.dom import HierarchyRequestErr, EMPTY_NAMESPACE
# localize the types, and allow support for Unicode values if available:
@@ -284,11 +280,10 @@ class Node(xml.dom.Node):
def _write_data(writer, data):
"Writes datachars to writer."
- replace = _string.replace
- data = replace(data, "&", "&amp;")
- data = replace(data, "<", "&lt;")
- data = replace(data, "\"", "&quot;")
- data = replace(data, ">", "&gt;")
+ data = data.replace("&", "&amp;")
+ data = data.replace("<", "&lt;")
+ data = data.replace("\"", "&quot;")
+ data = data.replace(">", "&gt;")
writer.write(data)
def _getElementsByTagNameHelper(parent, name, rc):
@@ -758,7 +753,7 @@ class CDATASection(Text):
def _nssplit(qualifiedName):
- fields = _string.split(qualifiedName, ':', 1)
+ fields = qualifiedName.split(':', 1)
if len(fields) == 2:
return fields
elif len(fields) == 1:
@@ -787,7 +782,7 @@ class DOMImplementation:
def hasFeature(self, feature, version):
if version not in ("1.0", "2.0"):
return 0
- feature = _string.lower(feature)
+ feature = feature.lower()
return feature == "core"
def createDocument(self, namespaceURI, qualifiedName, doctype):