Prevent exceptions in NetworkManager::createRequest.

This commit is contained in:
Florian Bruhin 2014-09-16 22:08:00 +02:00
parent 644dfe53e2
commit 3bded60ba6

View File

@ -30,7 +30,7 @@ else:
SSL_AVAILABLE = QSslSocket.supportsSsl()
from qutebrowser.config import config
from qutebrowser.utils import message, log, usertypes
from qutebrowser.utils import message, log, usertypes, utils
from qutebrowser.network import qutescheme, schemehandler
@ -113,6 +113,13 @@ class NetworkManager(QNetworkAccessManager):
authenticator.realm()), mode=usertypes.PromptMode.user_pwd)
self._fill_authenticator(authenticator, answer)
# WORKAROUND for:
# http://www.riverbankcomputing.com/pipermail/pyqt/2014-September/034806.html
#
# By returning False, we provoke a TypeError because of a wrong return
# type, which does *not* trigger a segfault but invoke our return handler
# immediately.
@utils.prevent_exceptions(False)
def createRequest(self, op, req, outgoing_data):
"""Return a new QNetworkReply object.