Mercurial > cpython-lru_cache-weakref
comparison Lib/HTMLParser.py @ 41575:beacf40b5960
Rip out all the u"..." literals and calls to unicode().
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Wed, 02 May 2007 19:09:54 +0000 |
| parents | 06145fbc7ab9 |
| children | 825d966338ea |
comparison
equal
deleted
inserted
replaced
| 41558:29ae667f3239 | 41575:beacf40b5960 |
|---|---|
| 374 else: | 374 else: |
| 375 # Cannot use name2codepoint directly, because HTMLParser supports apos, | 375 # Cannot use name2codepoint directly, because HTMLParser supports apos, |
| 376 # which is not part of HTML 4 | 376 # which is not part of HTML 4 |
| 377 import htmlentitydefs | 377 import htmlentitydefs |
| 378 if HTMLParser.entitydefs is None: | 378 if HTMLParser.entitydefs is None: |
| 379 entitydefs = HTMLParser.entitydefs = {'apos':u"'"} | 379 entitydefs = HTMLParser.entitydefs = {'apos':"'"} |
| 380 for k, v in htmlentitydefs.name2codepoint.items(): | 380 for k, v in htmlentitydefs.name2codepoint.items(): |
| 381 entitydefs[k] = unichr(v) | 381 entitydefs[k] = unichr(v) |
| 382 try: | 382 try: |
| 383 return self.entitydefs[s] | 383 return self.entitydefs[s] |
| 384 except KeyError: | 384 except KeyError: |
