Skip to content

Commit

Permalink
utils: use %-interpolation in strict kw error msg
Browse files Browse the repository at this point in the history
Signed-off-by: Szymon Łopaciuk <[email protected]>
  • Loading branch information
szymonlopaciuk committed Feb 1, 2018
1 parent 167e98b commit dfd1f97
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hepcrawl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit dfd1f97

Please sign in to comment.