- raise WrongArgumentsError(u'%s takes %s %s argument%s, %s given'
- % (handler.__name__, quant, n_ok, pl, n_bad))
+ raise WrongArgumentsError(handler, u'takes %s %s argument%s, '
+ '%s given' % (quant, n_ok, pl, n_bad))
+ m = kw_re.match(unicode(e))
+ if m:
+ (kw,) = m.groups()
+ raise WrongArgumentsError(handler,
+ u'got an unexpected keyword argument %s' % kw)