Skip to content

Commit 401eedb

Browse files
committed
Fix dealing with non-method descriptors in LookupSpecialMethod
1 parent ac20936 commit 401eedb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/call/special/LookupSpecialBaseNode.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ public final Object execute(VirtualFrame frame, Object type, Object receiver) {
8181
throw pe;
8282
}
8383
}
84-
return descriptor;
84+
// CPython considers non-descriptors already bound
85+
return new BoundDescriptor(descriptor);
8586
}
8687

8788
private LookupInheritedAttributeNode ensureLookupGet() {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/call/special/LookupSpecialMethodNode.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ Object lookup(Object type, Object name, Object receiver, boolean ignoreDescripto
109109
throw pe;
110110
}
111111
}
112-
return descriptor;
112+
// CPython considers non-descriptors already bound
113+
return new BoundDescriptor(descriptor);
113114
}
114115
}
115116
}

0 commit comments

Comments
 (0)