diff options
author | Guido van Rossum <guido@python.org> | 1990-12-20 23:12:40 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1990-12-20 23:12:40 (GMT) |
commit | 73531a3bae554998dd7d6d5d782d44fbf0da2ee8 (patch) | |
tree | 086f8611c592a963c627e50b5b1d7168920a8ff2 /Objects | |
parent | 6c4f4a92ac02d2d1321ab545294078896529db2c (diff) | |
download | cpython-73531a3bae554998dd7d6d5d782d44fbf0da2ee8.zip cpython-73531a3bae554998dd7d6d5d782d44fbf0da2ee8.tar.gz cpython-73531a3bae554998dd7d6d5d782d44fbf0da2ee8.tar.bz2 |
Return -1 for errors.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/moduleobject.c | 2 | ||||
-rw-r--r-- | Objects/object.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c index cf96a70..3d2cab2 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -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); diff --git a/Objects/object.c b/Objects/object.c index f2b4d1f..4170267 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -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); |