Skip to content

Commit f9ce7a7

Browse files
committed
Fix: 'iter' builtin should accept 'Object'.
1 parent b0f63ed commit f9ce7a7

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/BuiltinFunctions.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,7 @@ public abstract static class MinNode extends MinMaxNode {
11131113
public abstract static class NextNode extends PythonBuiltinNode {
11141114

11151115
@Specialization
1116-
public Object next(PythonObject iterator, PNone defaultObject,
1116+
public Object next(Object iterator, PNone defaultObject,
11171117
@Cached("create()") GetNextNode next,
11181118
@Cached("createBinaryProfile()") ConditionProfile errorProfile) {
11191119
try {
@@ -1123,11 +1123,6 @@ public Object next(PythonObject iterator, PNone defaultObject,
11231123
throw raise(TypeError, "'%p' object is not an iterator", iterator);
11241124
}
11251125
}
1126-
1127-
@Specialization
1128-
public Object next(Object iterator, Object defaultObject) {
1129-
throw new RuntimeException("Unsupported iterator " + iterator);
1130-
}
11311126
}
11321127

11331128
// ord(c)

0 commit comments

Comments
 (0)