Skip to content

Commit 1e379e1

Browse files
committed
update AttributeError message for types
1 parent 9e5b1ae commit 1e379e1

File tree

1 file changed

+2
-2
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/type

1 file changed

+2
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/type/TypeBuiltins.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public static GetattributeNode create() {
235235
@Child private LookupAttributeInMRONode attrRead;
236236

237237
@Specialization
238-
protected Object doIt(Object object, Object key) {
238+
protected Object doIt(PythonClass object, Object key) {
239239
Object descr = lookup.execute(object, key);
240240
PythonClass dataDescClass = null;
241241
Object get = null;
@@ -289,7 +289,7 @@ protected Object doIt(Object object, Object key) {
289289
}
290290
}
291291
errorProfile.enter();
292-
throw raise(AttributeError, "object has no attribute %s", key);
292+
throw raise(AttributeError, "type object '%s' has no attribute %s", object.getName(), key);
293293
}
294294

295295
private Object readAttribute(Object object, Object key) {

0 commit comments

Comments
 (0)