summaryrefslogtreecommitdiffstats
path: root/Lib/html/parser.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2008-05-17 21:14:05 (GMT)
committerFred Drake <fdrake@acm.org>2008-05-17 21:14:05 (GMT)
commitcb51d84214ed07268338392abef986b9a56d0141 (patch)
tree474b5ec5794e8e97953df73059c55d78cc2df631 /Lib/html/parser.py
parent91ae2502739ecfcc7a8a013473553224b8387521 (diff)
downloadcpython-cb51d84214ed07268338392abef986b9a56d0141.zip
cpython-cb51d84214ed07268338392abef986b9a56d0141.tar.gz
cpython-cb51d84214ed07268338392abef986b9a56d0141.tar.bz2
update references and documentation for modules in the new html package
(http://bugs.python.org/issue2882)
Diffstat (limited to 'Lib/html/parser.py')
-rw-r--r--Lib/html/parser.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/html/parser.py b/Lib/html/parser.py
index 2cbc2ec..b5010ac 100644
--- a/Lib/html/parser.py
+++ b/Lib/html/parser.py
@@ -372,16 +372,17 @@ class HTMLParser(markupbase.ParserBase):
c = int(s)
return unichr(c)
else:
- # Cannot use name2codepoint directly, because HTMLParser supports apos,
- # which is not part of HTML 4
- import htmlentitydefs
+ # Cannot use name2codepoint directly, because HTMLParser
+ # supports apos, which is not part of HTML 4
+ import html.entities
if HTMLParser.entitydefs is None:
entitydefs = HTMLParser.entitydefs = {'apos':u"'"}
- for k, v in htmlentitydefs.name2codepoint.iteritems():
+ for k, v in html.entities.name2codepoint.iteritems():
entitydefs[k] = unichr(v)
try:
return self.entitydefs[s]
except KeyError:
return '&'+s+';'
- return re.sub(r"&(#?[xX]?(?:[0-9a-fA-F]+|\w{1,8}));", replaceEntities, s)
+ return re.sub(r"&(#?[xX]?(?:[0-9a-fA-F]+|\w{1,8}));",
+ replaceEntities, s)