Skip to content

Commit 6921cde

Browse files
committed
destructuring assignment raise ValueError for too many values too unpack case
1 parent 78253b6 commit 6921cde

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/nodes/frame/DestructuringAssignmentNode.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import static com.oracle.graal.python.runtime.exception.PythonErrorType.AttributeError;
3131
import static com.oracle.graal.python.runtime.exception.PythonErrorType.IndexError;
3232
import static com.oracle.graal.python.runtime.exception.PythonErrorType.SyntaxError;
33+
import static com.oracle.graal.python.runtime.exception.PythonErrorType.ValueError;
3334

3435
import java.util.Arrays;
3536

@@ -175,7 +176,7 @@ public Object doWrite(VirtualFrame frame, Object rhsValue) {
175176
} catch (PException e) {
176177
notEnoughValuesProfile.enter();
177178
if (e.getType() == getCore().getErrorClass(IndexError)) {
178-
throw raise(SyntaxError, "not enough values to unpack");
179+
throw raise(ValueError, "not enough values to unpack");
179180
} else {
180181
otherErrorsProfile.enter();
181182
throw e;

0 commit comments

Comments
 (0)