Fixed exception handling in select_follow command.

This commit is contained in:
Antoni Boucher 2015-05-31 12:02:15 -04:00
parent 4ff9d585ea
commit c5c145320c

View File

@ -1006,12 +1006,13 @@ class CommandDispatcher:
try:
selected_element = xml.etree.ElementTree.fromstring(
'<html>' + widget.selectedHtml() + '</html>').find('a')
if selected_element is not None:
url = selected_element.attrib['href']
if url:
self._open(QUrl(url), tab)
except xml.etree.ElementTree.ParseError:
pass
raise cmdexc.CommandError('Parse error')
if selected_element is not None:
url = selected_element.attrib['href']
if url:
self._open(QUrl(url), tab)
@cmdutils.register(instance='command-dispatcher', name='inspector',
scope='window')