Skip to content

Commit

Permalink
fix breakage on python 3.9
Browse files Browse the repository at this point in the history
This commit fixes "AttributeError: 'HTMLParser' object has no attribute 'unescape'"
  • Loading branch information
BoleynSu authored Oct 28, 2020
1 parent d5ce5db commit 5dfa427
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions itchat/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

emojiRegex = re.compile(r'<span class="emoji emoji(.{1,10})"></span>')
htmlParser = HTMLParser()
if not hasattr(htmlParser, 'unescape'):
import html
htmlParser.unescape = html.unescape
try:
b = u'\u2588'
sys.stdout.write(b + '\r')
Expand Down

0 comments on commit 5dfa427

Please sign in to comment.