From 923fd893230a04e733d49513a607f71f1c24c932 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 22 Nov 2018 14:48:30 +0100 Subject: [PATCH] mypy: Fix int-issues in commands.py --- qutebrowser/browser/commands.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 0bb3d076b..2af938fb5 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -75,7 +75,7 @@ class CommandDispatcher: new_window.show() return new_window.tabbed_browser - def _count(self): + def _count(self) -> int: """Convenience method to get the widget count.""" return self._tabbed_browser.widget.count() @@ -1143,6 +1143,8 @@ class CommandDispatcher: self.tab_next() return + assert isinstance(index, int) + if index < 0: index = self._count() + index + 1 @@ -1184,6 +1186,7 @@ class CommandDispatcher: if config.val.tabs.wrap: new_idx %= self._count() else: + assert isinstance(index, int) # absolute moving if count is not None: new_idx = count - 1