Avoid pylint maybe-no-member warnings for ConfigParser.
This commit is contained in:
parent
6d709d9fd8
commit
581f88fcce
@ -202,7 +202,6 @@ class QuteBrowser(QApplication):
|
||||
|
||||
if not opened_urls:
|
||||
logging.debug('Opening startpage')
|
||||
# pylint: disable=maybe-no-member
|
||||
for url in config.config.get('general', 'startpage').split(','):
|
||||
self.mainwindow.tabs.tabopen(url)
|
||||
|
||||
|
@ -193,12 +193,16 @@ class Config(ConfigParser):
|
||||
|
||||
"""
|
||||
# pylint: disable=redefined-builtin
|
||||
# The arguments returned by the ConfigParsers actually are strings
|
||||
# already, but we add an explicit str() here to trick pylint into
|
||||
# thinking a string is returned (rather than an object) to avoid
|
||||
# maybe-no-member errors.
|
||||
try:
|
||||
return super().get(*args, raw=raw, vars=vars)
|
||||
return str(super().get(*args, raw=raw, vars=vars))
|
||||
except (NoSectionError, NoOptionError):
|
||||
pass
|
||||
try:
|
||||
return self._default_cp.get(*args, raw=raw, vars=vars)
|
||||
return str(self._default_cp.get(*args, raw=raw, vars=vars))
|
||||
except (NoSectionError, NoOptionError):
|
||||
if fallback is _UNSET:
|
||||
raise
|
||||
|
@ -45,7 +45,6 @@ def _get_search_url(txt):
|
||||
logging.debug('engine: default, term "{}"'.format(txt))
|
||||
if template is None or not term:
|
||||
raise ValueError
|
||||
# pylint: disable=maybe-no-member
|
||||
return QUrl.fromUserInput(template.format(urllib.parse.quote(term)))
|
||||
|
||||
|
||||
|
@ -86,7 +86,6 @@ class TabWidget(QTabWidget):
|
||||
'right': QTabBar.SelectRightTab,
|
||||
'previous': QTabBar.SelectPreviousTab,
|
||||
}
|
||||
# pylint: disable=maybe-no-member
|
||||
self.setMovable(config.config.getboolean('tabbar', 'movable'))
|
||||
self.setTabsClosable(config.config.getboolean('tabbar',
|
||||
'closebuttons'))
|
||||
|
Loading…
Reference in New Issue
Block a user