From e50b6912a728ea219d85485ca1bb6395c33be9e9 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 16 Jul 2018 14:33:11 +0200 Subject: [PATCH] Fix pylint 2.0 useless-return cases See https://github.com/PyCQA/pylint/issues/2300 --- qutebrowser/browser/webengine/webenginetab.py | 4 ++-- qutebrowser/misc/miscwidgets.py | 4 ++-- qutebrowser/misc/utilcmds.py | 2 +- tests/end2end/fixtures/test_quteprocess.py | 2 +- tests/helpers/stubs.py | 4 ++-- tests/unit/utils/test_qtutils.py | 2 +- tests/unit/utils/test_utils.py | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 9bc246107..dcde5c434 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -1086,10 +1086,10 @@ class WebEngineTab(browsertab.AbstractTab): # percent encoded content is 2 megabytes minus 30 bytes. self._widget.setHtml(html, base_url) - def networkaccessmanager(self): + def networkaccessmanager(self): # pylint: disable=useless-return return None - def user_agent(self): + def user_agent(self): # pylint: disable=useless-return return None def clear_ssl_errors(self): diff --git a/qutebrowser/misc/miscwidgets.py b/qutebrowser/misc/miscwidgets.py index eef127cf2..bc0afea24 100644 --- a/qutebrowser/misc/miscwidgets.py +++ b/qutebrowser/misc/miscwidgets.py @@ -246,7 +246,7 @@ class WrapperLayout(QLayout): def sizeHint(self): return self._widget.sizeHint() - def itemAt(self, _index): + def itemAt(self, _index): # pylint: disable=useless-return return None def takeAt(self, _index): @@ -287,7 +287,7 @@ class PseudoLayout(QLayout): def count(self): return 0 - def itemAt(self, _pos): + def itemAt(self, _pos): # pylint: disable=useless-return return None def widget(self): diff --git a/qutebrowser/misc/utilcmds.py b/qutebrowser/misc/utilcmds.py index 66483e09a..702c62cac 100644 --- a/qutebrowser/misc/utilcmds.py +++ b/qutebrowser/misc/utilcmds.py @@ -365,7 +365,7 @@ def window_only(current_win_id): @cmdutils.register() def nop(): """Do nothing.""" - return + pass @cmdutils.register() diff --git a/tests/end2end/fixtures/test_quteprocess.py b/tests/end2end/fixtures/test_quteprocess.py index a0dcaf5ce..9a6f5b19d 100644 --- a/tests/end2end/fixtures/test_quteprocess.py +++ b/tests/end2end/fixtures/test_quteprocess.py @@ -68,7 +68,7 @@ class FakeNode: def __init__(self, call): self.rep_call = call - def get_closest_marker(self, _name): + def get_closest_marker(self, _name): # pylint: disable=useless-return return None diff --git a/tests/helpers/stubs.py b/tests/helpers/stubs.py index 84e5b0125..808061976 100644 --- a/tests/helpers/stubs.py +++ b/tests/helpers/stubs.py @@ -44,7 +44,7 @@ class FakeNetworkCache(QAbstractNetworkCache): def cacheSize(self): return 0 - def data(self, _url): + def data(self, _url): # pylint: disable=useless-return return None def insert(self, _dev): @@ -53,7 +53,7 @@ class FakeNetworkCache(QAbstractNetworkCache): def metaData(self, _url): return QNetworkCacheMetaData() - def prepare(self, _metadata): + def prepare(self, _metadata): # pylint: disable=useless-return return None def remove(self, _url): diff --git a/tests/unit/utils/test_qtutils.py b/tests/unit/utils/test_qtutils.py index 3a848474f..0825d1fb3 100644 --- a/tests/unit/utils/test_qtutils.py +++ b/tests/unit/utils/test_qtutils.py @@ -575,7 +575,7 @@ class FailingQIODevice(QIODevice): self.setErrorString("Writing failed") return -1 - def read(self, _maxsize): + def read(self, _maxsize): # pylint: disable=useless-return """Simulate failed read.""" self.setErrorString("Reading failed") return None diff --git a/tests/unit/utils/test_utils.py b/tests/unit/utils/test_utils.py index ef2b6c8d4..54ea07a69 100644 --- a/tests/unit/utils/test_utils.py +++ b/tests/unit/utils/test_utils.py @@ -410,11 +410,11 @@ class GotException(Exception): def excepthook(_exc, _val, _tb): - return + pass def excepthook_2(_exc, _val, _tb): - return + pass class TestDisabledExcepthook: