mirror of https://github.com/python/cpython
Return -1 for errors.
This commit is contained in:
parent
6c4f4a92ac
commit
73531a3bae
|
@ -107,7 +107,7 @@ module_setattr(m, name, v)
|
|||
{
|
||||
if (strcmp(name, "__dict__") == 0 || strcmp(name, "__name__") == 0) {
|
||||
err_setstr(NameError, "can't assign to reserved member name");
|
||||
return NULL;
|
||||
return -1;
|
||||
}
|
||||
if (v == NULL)
|
||||
return dictremove(m->md_dict, name);
|
||||
|
|
|
@ -157,7 +157,7 @@ setattr(v, name, w)
|
|||
err_setstr(TypeError, "attribute-less object");
|
||||
else
|
||||
err_setstr(TypeError, "object has read-only attributes");
|
||||
return NULL;
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
return (*v->ob_type->tp_setattr)(v, name, w);
|
||||
|
|
|
@ -130,5 +130,5 @@ setmember(addr, mlist, name, v)
|
|||
}
|
||||
|
||||
err_setstr(NameError, name);
|
||||
return NULL;
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue