From 73531a3bae554998dd7d6d5d782d44fbf0da2ee8 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 20 Dec 1990 23:12:40 +0000 Subject: Return -1 for errors. --- Objects/moduleobject.c | 2 +- Objects/object.c | 2 +- Python/structmember.c | 2 +- 3 files changed, 3 insertions(+), 3 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); diff --git a/Python/structmember.c b/Python/structmember.c index 42c563e..b5f9bc3 100644 --- a/Python/structmember.c +++ b/Python/structmember.c @@ -130,5 +130,5 @@ setmember(addr, mlist, name, v) } err_setstr(NameError, name); - return NULL; + return -1; } -- cgit v0.12