Skip to content

Commit 05d90dc

Browse files
committed
allow standard concat path for empty storage when the resulting length is also 0
1 parent 2ffb651 commit 05d90dc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/sequence/storage/EmptySequenceStorage.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ public int length() {
7979

8080
@Override
8181
public void setNewLength(int length) {
82-
CompilerDirectives.transferToInterpreter();
83-
throw PythonLanguage.getContextRef().get().getCore().raise(ValueError, "list length out of range");
82+
if (length != 0) {
83+
CompilerDirectives.transferToInterpreter();
84+
throw PythonLanguage.getContextRef().get().getCore().raise(ValueError, "list length out of range");
85+
}
8486
}
8587

8688
@Override

0 commit comments

Comments
 (0)