Return None instead of a parser if there are no parsers.
git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@268
fdd5c36f-1aea-0310-aeeb-
c58d7e2b6c23
else:
parsers.append(parse_html_beautifulsoup.parse_html)
-from parse_html_htmlparser import parse_html
-parsers.append(parse_html)
+try:
+ from parse_html_htmlparser import parse_html
+except ImportError:
+ pass
+else:
+ parsers.append(parse_html)
import re
def parse_html(filename, charset=None, log=None):
+ if not parsers:
+ return None
+
if charset:
try:
codecs.lookup(charset) # In case of unknown charset...