From dfd1f97641ed80ff1c8c2000a2097d1754b85f0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20=C5=81opaciuk?= Date: Thu, 1 Feb 2018 17:47:49 +0100 Subject: [PATCH] utils: use %-interpolation in strict kw error msg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Szymon Łopaciuk --- hepcrawl/utils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hepcrawl/utils.py b/hepcrawl/utils.py index 924530b5..1911ef8e 100644 --- a/hepcrawl/utils.py +++ b/hepcrawl/utils.py @@ -419,8 +419,12 @@ def wrapper(self, *args, **kwargs): if disallowed_kwargs: raise TypeError( - 'Only underscored kwargs allowed in {}. ' - 'Check {} for typos.'.format(repr(func), repr(disallowed_kwargs)) + 'Only underscored kwargs or %s allowed in %s. ' + 'Check %s for typos.' % ( + ', '.join(spider_fields), + func, + ', '.join(disallowed_kwargs), + ) ) return func(self, *args, **kwargs)