Fix pylint 2.0 useless-return cases

See https://github.com/PyCQA/pylint/issues/2300
This commit is contained in:
Florian Bruhin 2018-07-16 14:33:11 +02:00
parent b1d508a3af
commit e50b6912a7
7 changed files with 11 additions and 11 deletions

View File

@ -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):

View File

@ -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):

View File

@ -365,7 +365,7 @@ def window_only(current_win_id):
@cmdutils.register()
def nop():
"""Do nothing."""
return
pass
@cmdutils.register()

View File

@ -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

View File

@ -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):

View File

@ -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

View File

@ -410,11 +410,11 @@ class GotException(Exception):
def excepthook(_exc, _val, _tb):
return
pass
def excepthook_2(_exc, _val, _tb):
return
pass
class TestDisabledExcepthook: