Fixed to use qualified import.

This commit is contained in:
Antoni Boucher 2015-05-31 11:56:27 -04:00
parent b1f8a70c02
commit 4ff9d585ea

View File

@ -25,7 +25,7 @@ import shlex
import subprocess import subprocess
import posixpath import posixpath
import functools import functools
from xml.etree import ElementTree import xml.etree.ElementTree
from PyQt5.QtWebKit import QWebSettings from PyQt5.QtWebKit import QWebSettings
from PyQt5.QtWidgets import QApplication, QTabBar from PyQt5.QtWidgets import QApplication, QTabBar
@ -1004,13 +1004,13 @@ class CommandDispatcher:
'window.getSelection().anchorNode.parentNode.click()') 'window.getSelection().anchorNode.parentNode.click()')
else: else:
try: try:
selected_element = ElementTree.fromstring( selected_element = xml.etree.ElementTree.fromstring(
'<html>' + widget.selectedHtml() + '</html>').find('a') '<html>' + widget.selectedHtml() + '</html>').find('a')
if selected_element is not None: if selected_element is not None:
url = selected_element.attrib['href'] url = selected_element.attrib['href']
if url: if url:
self._open(QUrl(url), tab) self._open(QUrl(url), tab)
except ElementTree.ParseError: except xml.etree.ElementTree.ParseError:
pass pass
@cmdutils.register(instance='command-dispatcher', name='inspector', @cmdutils.register(instance='command-dispatcher', name='inspector',