mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-24 05:20:17 +00:00
change AttributeError's error msg
This commit is contained in:
parent
8693de9e59
commit
51ab011253
@ -372,7 +372,11 @@ public:
|
||||
|
||||
void AttributeError(PyObject* obj, StrName name){
|
||||
// OBJ_NAME calls getattr, which may lead to a infinite recursion
|
||||
_error("AttributeError", fmt("type ", OBJ_NAME(_t(obj)).escape(), " has no attribute ", name.escape()));
|
||||
if(isinstance(obj, vm->tp_type)){
|
||||
_error("AttributeError", fmt("type object ", OBJ_NAME(obj).escape(), " has no attribute ", name.escape()));
|
||||
}else{
|
||||
_error("AttributeError", fmt(OBJ_NAME(_t(obj)).escape(), " object has no attribute ", name.escape()));
|
||||
}
|
||||
}
|
||||
|
||||
void AttributeError(Str msg){ _error("AttributeError", msg); }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user