mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
fixed bugs in generic_setattr (returned NULL instead of
-1 for errors)
This commit is contained in:
parent
000239517d
commit
3dd8c9895e
1 changed files with 2 additions and 2 deletions
|
@ -325,7 +325,7 @@ generic_setattr(g, name, v)
|
|||
|
||||
if (v == NULL) {
|
||||
err_setstr(TypeError, "can't delete forms object attributes");
|
||||
return NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* "label" is an exception: setmember doesn't set strings;
|
||||
|
@ -333,7 +333,7 @@ generic_setattr(g, name, v)
|
|||
if (strcmp(name, "label") == 0) {
|
||||
if (!is_stringobject(v)) {
|
||||
err_setstr(TypeError, "label attr must be string");
|
||||
return NULL;
|
||||
return -1;
|
||||
}
|
||||
fl_set_object_label(g->ob_generic, getstringvalue(v));
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue