Skip to content

Commit 0b9b717

Browse files
committed
don't use __iter__ for list from string, this leads to an endless recursion
1 parent d10520e commit 0b9b717

File tree

1 file changed

+1
-1
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/builtins

1 file changed

+1
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/builtins/ListNodes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ public PList listIterable(PythonClass cls, @SuppressWarnings("unused") PNone non
320320
return factory().createList(cls);
321321
}
322322

323-
@Specialization(guards = "!isNoValue(iterable)")
323+
@Specialization(guards = {"!isNoValue(iterable)", "!isString(iterable)"})
324324
public PList listIterable(PythonClass cls, Object iterable, @SuppressWarnings("unused") PythonClass valueClass,
325325
@Cached("create()") GetIteratorNode getIteratorNode,
326326
@Cached("create()") CreateListFromIteratorNode createListFromIteratorNode) {

0 commit comments

Comments
 (0)