diff options
| author | Tim Graham <timograham@gmail.com> | 2014-11-04 20:56:00 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-11-05 09:54:35 -0500 |
| commit | b07aa52e8a8e4c7fdc7265f75ce2e7992e657ae9 (patch) | |
| tree | ddb554ae3b1f7fbf11acb3d4f5e433ab55f21a28 /django/utils/html_parser.py | |
| parent | 9f4c718b2f3b09ce23a837853ba2289cec85ae4f (diff) | |
Added a dummy class for HTMLParserError; refs #23763.
Diffstat (limited to 'django/utils/html_parser.py')
| -rw-r--r-- | django/utils/html_parser.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/django/utils/html_parser.py b/django/utils/html_parser.py index efe54227d3..ab1f654978 100644 --- a/django/utils/html_parser.py +++ b/django/utils/html_parser.py @@ -9,7 +9,12 @@ use_workaround = ( (current_version >= (3, 0) and current_version < (3, 2, 3)) ) -HTMLParseError = _html_parser.HTMLParseError +try: + HTMLParseError = _html_parser.HTMLParseError +except AttributeError: + # create a dummy class for Python 3.5+ where it's been removed + class HTMLParseError(Exception): + pass if not use_workaround: if current_version >= (3, 4): |
