cmark

My personal build of CMark ✏️

Commit
2c39cdc8989c6fd855d11bc8bd66230964cb4859
Parent
3e0fa0695e26d1d77af8ebc8d70ed8817303a0b3
Author
John MacFarlane <jgm@berkeley.edu>
Date

Merge pull request #84 from zmwangx/python3.5-compat-fix

Python 3.5 compatibility fix: add placeholder for HTMLParseError

Diffstat

1 file changed, 10 insertions, 1 deletion

Status File Name N° Changes Insertions Deletions
Modified test/normalize.py 11 10 1
diff --git 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