Skip to content

Commit 715931a

Browse files
committed
adjust AttributeError message when attribute not found
1 parent 6b5aedd commit 715931a

File tree

1 file changed

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

1 file changed

+2
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/object/ObjectBuiltins.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ private LazyPythonClass getDataClass(Object descr) {
403403
public abstract static class GetattrNode extends PythonBinaryBuiltinNode {
404404
@Specialization
405405
Object getattr(Object object, Object key) {
406-
throw raise(AttributeError, "'%p' object has no attribute %s", object, key);
406+
throw raise(AttributeError, "'%p' object has no attribute '%s'", object, key);
407407
}
408408
}
409409

@@ -470,7 +470,7 @@ protected PNone doIt(Object object, Object key,
470470
if (descr != PNone.NO_VALUE) {
471471
throw raise(AttributeError, "attribute % is read-only", key);
472472
} else {
473-
throw raise(AttributeError, "%s object has no attribute %s", object, key);
473+
throw raise(AttributeError, "%s object has no attribute '%s'", object, key);
474474
}
475475
}
476476
}

0 commit comments

Comments
 (0)