Fix warnings from tox

This commit is contained in:
Martin Tournoij 2015-06-30 11:41:47 +02:00
parent 63dae3a885
commit aa909c0506
3 changed files with 6 additions and 4 deletions

View File

@ -153,7 +153,7 @@ def qute_help(win_id, request):
"""Handler for qute:help. Return HTML content as bytes."""
try:
utils.read_file('html/doc/index.html')
except (FileNotFoundError, NotADirectoryError, OSError, BlockingIOError):
except FileNotFoundError:
html = jinja.env.get_template('error.html').render(
title="Error while loading documentation",
url=request.url().toDisplayString(),

View File

@ -23,7 +23,7 @@ import functools
import collections
from PyQt5.QtWidgets import QSizePolicy
from PyQt5.QtCore import pyqtSignal, pyqtSlot, QSize, QTimer, QUrl
from PyQt5.QtCore import pyqtSignal, pyqtSlot, QTimer, QUrl
from PyQt5.QtGui import QIcon
from qutebrowser.config import config

View File

@ -24,7 +24,8 @@ Module attributes:
between items.
"""
import functools, math
import functools
import math
from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt, QSize, QRect, QPoint, QTimer
from PyQt5.QtWidgets import (QTabWidget, QTabBar, QSizePolicy, QCommonStyle,
@ -296,7 +297,8 @@ class TabBar(QTabBar):
"""Set the tab bar font."""
self.setFont(config.get('fonts', 'tabbar'))
def resizeEvent(self, s):
def resizeEvent(self, _s):
"""Set the favicon size to the tabbar size minus some padding."""
height = self.size().height()
if height > 0:
height = math.ceil(height - height / 7)