Skip to content

Commit 31f79d2

Browse files
committed
ExecutePositionalStarargsNode: raise TypeError on *None
1 parent 987bd17 commit 31f79d2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/argument/positional/ExecutePositionalStarargsNode.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,9 @@ static Object[] doSet(PSet starargs,
122122
}
123123

124124
@Specialization
125-
static Object[] doNone(@SuppressWarnings("unused") PNone none) {
126-
return PythonUtils.EMPTY_OBJECT_ARRAY;
125+
static Object[] doNone(PNone none,
126+
@Cached PRaiseNode raise) {
127+
throw raise.raise(PythonErrorType.TypeError, ErrorMessages.ARG_AFTER_MUST_BE_ITERABLE, none);
127128
}
128129

129130
@Specialization(limit = "getCallSiteInlineCacheMaxDepth()")
@@ -196,8 +197,9 @@ static Object[] doSet(PSet starargs,
196197
}
197198

198199
@Specialization
199-
static Object[] starargs(@SuppressWarnings("unused") PNone none) {
200-
return ExecutePositionalStarargsNode.doNone(none);
200+
static Object[] starargs(PNone none,
201+
@Cached PRaiseNode raise) {
202+
return ExecutePositionalStarargsNode.doNone(none, raise);
201203
}
202204

203205
@Specialization(limit = "getCallSiteInlineCacheMaxDepth()")

0 commit comments

Comments
 (0)