Skip to content

Commit 8805f14

Browse files
committed
Fixes #836 and corrects exception message
1 parent 3127cd6 commit 8805f14

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/runtime/objmodel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3293,8 +3293,8 @@ void rearrangeArguments(ParamReceiveSpec paramspec, const ParamNames* param_name
32933293
getArg(kwargs_idx, oarg1, oarg2, oarg3, oargs) = okwargs;
32943294
}
32953295

3296-
if ((!param_names || !param_names->takes_param_names) && argspec.num_keywords && !paramspec.takes_kwargs) {
3297-
raiseExcHelper(TypeError, "%s() doesn't take keyword arguments", func_name);
3296+
if ((!param_names || !param_names->takes_param_names) && (argspec.num_keywords || argspec.has_kwargs) && !paramspec.takes_kwargs) {
3297+
raiseExcHelper(TypeError, "%s() takes no keyword arguments", func_name);
32983298
}
32993299

33003300
if (argspec.num_keywords)

0 commit comments

Comments
 (0)