Skip to content

Commit f95eee0

Browse files
gh-XXXXX: Fix optparse._check_callback TypeError for tuple callback_kwargs
%r % tuple unpacks the tuple as multiple format args, raising TypeError instead of OptionError. Wrap in a 1-tuple: % (value,).
1 parent 5944a53 commit f95eee0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/optparse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ def _check_callback(self):
704704
not isinstance(self.callback_kwargs, dict)):
705705
raise OptionError(
706706
"callback_kwargs, if supplied, must be a dict: not %r"
707-
% self.callback_kwargs, self)
707+
% (self.callback_kwargs,), self)
708708
else:
709709
if self.callback is not None:
710710
raise OptionError(

0 commit comments

Comments
 (0)