From 4b759c5513b6ba115621e28a721f4ed0d34176f5 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 14 Sep 2014 22:48:00 +0200 Subject: [PATCH] cmdutils: Make sure functions don't have **kwargs. --- qutebrowser/commands/cmdutils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qutebrowser/commands/cmdutils.py b/qutebrowser/commands/cmdutils.py index 398bbed32..0b5e285b5 100644 --- a/qutebrowser/commands/cmdutils.py +++ b/qutebrowser/commands/cmdutils.py @@ -227,6 +227,9 @@ class register: # pylint: disable=invalid-name elif 'self' not in signature.parameters and self.instance is not None: raise TypeError("{} is not a class method, but instance was " "given!".format(self.name[0])) + elif inspect.getfullargspec(self.func).varkw is not None: + raise TypeError("{}: functions with varkw arguments are not " + "supported!".format(self.name[0])) has_count = 'count' in signature.parameters doc = inspect.getdoc(self.func) if doc is not None: