Skip to content

Commit 4645eac

Browse files
committed
Fix check for excess args in tuple arg parse
1 parent cbfaec8 commit 4645eac

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/common/CExtParseArgumentsNode.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,8 @@ static ParserState doParClose(ParserState state, @SuppressWarnings("unused") Obj
10821082
throw ParseArgumentsException.raise();
10831083
}
10841084
int len = lenNode.execute(state.v.argv.getSequenceStorage());
1085-
if (len != state.v.argnum) {
1085+
// Only check for excess. Too few arguments are checked when obtaining them
1086+
if (len > state.v.argnum) {
10861087
throw raise(raiseNode, TypeError, "must be sequence of length %d, not %d", state.v.argnum, len);
10871088
}
10881089
return state.close();

0 commit comments

Comments
 (0)