Skip to content

Commit

Permalink
'hasKw' is not sufficient to check if a function received kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
klange committed Dec 13, 2022
1 parent c3e1226 commit eef9559
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ KRK_Method(map,__call__) {
#define IS_zip(o) (krk_isInstanceOf(o,KRK_BASE_CLASS(zip)))
#define AS_zip(o) (AS_INSTANCE(o))
KRK_Method(zip,__init__) {
if (hasKw) return krk_runtimeError(vm.exceptions->typeError, "%s() takes no keyword arguments", "zip");
if (hasKw && AS_DICT(argv[argc])->count) return krk_runtimeError(vm.exceptions->typeError, "%s() takes no keyword arguments", "zip");

KrkTuple * iters = krk_newTuple(argc - 1);
krk_push(OBJECT_VAL(iters));
Expand Down

0 comments on commit eef9559

Please sign in to comment.