Skip to content

Apache Lucene open-source search software

HTMLParserError is gone as of Python 3.5

Michael McCandless8760269fcf63
diff --git a/dev-tools/scripts/checkJavadocLinks.py b/dev-tools/scripts/checkJavadocLinks.py
index b7b9a5614a2..74b843a4563 100644
--- a/dev-tools/scripts/checkJavadocLinks.py
+++ b/dev-tools/scripts/checkJavadocLinks.py
@@ -17,7 +17,7 @@ import traceback
import os
import sys
import re
-from html.parser import HTMLParser, HTMLParseError
+from html.parser import HTMLParser
import urllib.parse as urlparse
reHyperlink = re.compile(r'<a(\s+.*?)>', re.I)
@@ -109,7 +109,8 @@ def parse(baseURL, html):
try:
parser.feed(html)
parser.close()
- except HTMLParseError:
+ except:
+ # TODO: Python's html.parser is now always lenient, which is no good for us: we want correct HTML in our javadocs
parser.printFile()
print(' WARNING: failed to parse %s:' % baseURL)
traceback.print_exc(file=sys.stdout)