diff options
Diffstat (limited to 'test/normalize.py')
-rw-r--r-- | test/normalize.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/normalize.py b/test/normalize.py index 70bee46..9025bfa 100644 --- a/test/normalize.py +++ b/test/normalize.py @@ -1,5 +1,14 @@ # -*- coding: utf-8 -*- -from html.parser import HTMLParser, HTMLParseError +from html.parser import HTMLParser + +try: + from html.parser import HTMLParseError +except ImportError: + # HTMLParseError was removed in Python 3.5. It could never be + # thrown, so we define a placeholder instead. + class HTMLParseError(Exception): + pass + from html.entities import name2codepoint import sys import re |