You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/iterator/IteratorNodes.java
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -103,14 +103,14 @@ int length(VirtualFrame frame, Object iterable,
103
103
@CachedPRaiseNoderaiseNode) {
104
104
Objectclazz = plib.getLazyPythonClass(iterable);
105
105
ObjectattrLenObj = lenNode.execute(clazz);
106
-
if (hasLenProfile.profile(attrLenObj != PNone.NO_VALUE && attrLenObj != PNotImplemented.NOT_IMPLEMENTED)) {
106
+
if (hasLenProfile.profile(attrLenObj != PNone.NO_VALUE)) {
107
107
Objectlen = null;
108
108
try {
109
109
len = dispatchGetattribute.executeObject(frame, attrLenObj, iterable);
110
110
} catch (PExceptione) {
111
111
e.expect(TypeError, errorProfile);
112
112
}
113
-
if (len != null) {
113
+
if (len != null && len != PNotImplemented.NOT_IMPLEMENTED) {
114
114
if (toInt.canBeIndex(len)) {
115
115
intintLen = cast.execute(toInt.asIndex(len));
116
116
if (intLen < 0) {
@@ -123,14 +123,14 @@ int length(VirtualFrame frame, Object iterable,
0 commit comments