diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 122c4e51e..f8ad7e2cc 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -824,8 +824,7 @@ class WebEngineTab(browsertab.AbstractTab): # https://bugreports.qt.io/browse/QTBUG-61506 self.search.clear() super()._on_load_started() - if self.data.netrc_used: - self.data.netrc_used = False + self.data.netrc_used = False @pyqtSlot(QWebEnginePage.RenderProcessTerminationStatus, int) def _on_render_process_terminated(self, status, exitcode): diff --git a/qutebrowser/browser/webkit/network/networkmanager.py b/qutebrowser/browser/webkit/network/networkmanager.py index 50fb53b35..8ad486d29 100644 --- a/qutebrowser/browser/webkit/network/networkmanager.py +++ b/qutebrowser/browser/webkit/network/networkmanager.py @@ -270,11 +270,12 @@ class NetworkManager(QNetworkAccessManager): @pyqtSlot('QNetworkReply*', 'QAuthenticator*') def on_authentication_required(self, reply, authenticator): """Called when a website needs authentication.""" - netrc = False + netrc_success = False if not self.netrc_used: self.netrc_used = True - netrc = shared.netrc_authentication(reply.url(), authenticator) - if not netrc: + netrc_success = shared.netrc_authentication(reply.url(), + authenticator) + if not netrc_success: abort_on = self._get_abort_signals(reply) shared.authentication_required(reply.url(), authenticator, abort_on=abort_on) diff --git a/qutebrowser/browser/webkit/webkittab.py b/qutebrowser/browser/webkit/webkittab.py index 9c4d2bf66..9395630db 100644 --- a/qutebrowser/browser/webkit/webkittab.py +++ b/qutebrowser/browser/webkit/webkittab.py @@ -729,9 +729,7 @@ class WebKitTab(browsertab.AbstractTab): @pyqtSlot() def _on_load_started(self): super()._on_load_started() - nam = self.networkaccessmanager() - if nam.netrc_used: - nam.netrc_used = False + self.networkaccessmanager().netrc_used = False @pyqtSlot() def _on_frame_load_finished(self):