From 81f25251a54f929650ac3b47381c2ab4160838da Mon Sep 17 00:00:00 2001 From: Jan Verbeek Date: Mon, 27 Jun 2016 18:21:35 +0200 Subject: [PATCH] Fix singleton-comparison --- qutebrowser/browser/commands.py | 4 ++-- qutebrowser/commands/runners.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 8acfea948..95f69e663 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -1981,8 +1981,8 @@ class CommandDispatcher: Args: count: Which numeric argument to give the command. """ - if runners._last_command == None: + if runners._last_command is None: raise cmdexc.CommandError("You didn't do anything yet.") runners.CommandRunner(self._win_id).run( runners._last_command[0], - count if count != None else runners._last_command[1]) + count if count is not None else runners._last_command[1]) diff --git a/qutebrowser/commands/runners.py b/qutebrowser/commands/runners.py index 375a0e035..7581ae719 100644 --- a/qutebrowser/commands/runners.py +++ b/qutebrowser/commands/runners.py @@ -287,9 +287,9 @@ class CommandRunner(QObject): result.cmd.run(self._win_id, args) if (result.cmdline[0] != 'repeat-command' and - (result.cmd._modes == None or + (result.cmd._modes is None or usertypes.KeyMode.normal in result.cmd._modes) and - (result.cmd._not_modes == None or + (result.cmd._not_modes is None or usertypes.KeyMode.normal not in result.cmd._not_modes)): global _last_command _last_command = (text, count)