mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Rename 'unicode' to 'str' in its tp_name field. Rename 'str' to 'str8'.
Change all occurrences of unichr to chr.
This commit is contained in:
parent
ef87d6ed94
commit
84fc66dd02
17 changed files with 45 additions and 66 deletions
|
@ -370,7 +370,7 @@ class HTMLParser(markupbase.ParserBase):
|
|||
c = int(s[1:], 16)
|
||||
else:
|
||||
c = int(s)
|
||||
return unichr(c)
|
||||
return chr(c)
|
||||
else:
|
||||
# Cannot use name2codepoint directly, because HTMLParser supports apos,
|
||||
# which is not part of HTML 4
|
||||
|
@ -378,7 +378,7 @@ class HTMLParser(markupbase.ParserBase):
|
|||
if HTMLParser.entitydefs is None:
|
||||
entitydefs = HTMLParser.entitydefs = {'apos':"'"}
|
||||
for k, v in htmlentitydefs.name2codepoint.items():
|
||||
entitydefs[k] = unichr(v)
|
||||
entitydefs[k] = chr(v)
|
||||
try:
|
||||
return self.entitydefs[s]
|
||||
except KeyError:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue