Only do mhtml import in DownloadManager.get_mhtml

We also import qtnetworkdownloads on QtWebEngine without QtWebKit available, so
we can't be sure we can import mhtml.
This commit is contained in:
Florian Bruhin 2017-02-08 12:03:32 +01:00
parent 8226afd167
commit 0130866e89

View File

@ -29,7 +29,7 @@ from PyQt5.QtNetwork import QNetworkRequest, QNetworkReply
from qutebrowser.utils import message, usertypes, log, urlutils, utils
from qutebrowser.browser import downloads
from qutebrowser.browser.webkit import http, mhtml
from qutebrowser.browser.webkit import http
from qutebrowser.browser.webkit.network import networkmanager
@ -388,6 +388,7 @@ class DownloadManager(downloads.AbstractDownloadManager):
def get_mhtml(self, tab, target):
"""Download the given tab as mhtml to the given DownloadTarget."""
assert tab.backend == usertypes.Backend.QtWebKit
from qutebrowser.browser.webkit import mhtml
if target is not None:
mhtml.start_download_checked(target, tab=tab)