From 6cccd18be81133ce57c885ecad9e012a16a3fe8b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 2 Nov 2019 07:24:10 +0530 Subject: [PATCH] Workaround for AJAX breakage on Qt 5.13.2 Fixes #1850975 [qt5-webengine 5.13.2 breaks ebook-viewer](https://bugs.launchpad.net/calibre/+bug/1850975) --- src/pyj/ajax.pyj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pyj/ajax.pyj b/src/pyj/ajax.pyj index 3a43984903..5a038eaed5 100644 --- a/src/pyj/ajax.pyj +++ b/src/pyj/ajax.pyj @@ -102,6 +102,9 @@ def ajax(path, on_complete, on_progress=None, bypass_cache=True, method='GET', q is_network_error = ev if end_type is 'error' else False if xhr.status is not ok_code and end_type is 'load': end_type = 'error' + if xhr.status is ok_code and end_type is 'error': + # this apparently happens on Qt 5.13.2 + end_type = 'load' if end_type is not 'load': set_error(end_type, is_network_error) on_complete(end_type, xhr, ev)