Avoid error print on shutdown

This commit is contained in:
Kovid Goyal 2019-09-10 17:43:05 +05:30
parent 26b44e936c
commit 1d64be1032
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 3 deletions

View File

@ -190,7 +190,7 @@ class UrlSchemeHandler(QWebEngineUrlSchemeHandler):
QTimer.singleShot(0, self.check_for_parse)
else:
data = get_data(name)
if isinstance(data, type('')):
if isinstance(data, unicode_type):
data = data.encode('utf-8')
mime_type = {
# Prevent warning in console about mimetype of fonts

View File

@ -143,6 +143,7 @@ def live_css(editor_name, sourceline, tags):
for node in document.querySelectorAll(f'[data-lnum="{sourceline}"]'):
tn = node.tagName.toLowerCase() if node.tagName else ''
if tn is not tags[i]:
if to_python.live_css_data:
to_python.live_css_data(ans)
return
i += 1
@ -162,6 +163,7 @@ def live_css(editor_name, sourceline, tags):
})
target = target.parentNode
ancestor_specificity += 1
if to_python.live_css_data:
to_python.live_css_data(ans)