diff options
author | Guido van Rossum <guido@python.org> | 1990-10-21 22:15:08 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1990-10-21 22:15:08 (GMT) |
commit | 2a9096b5f9d90c6d90a9386c82214237ffc69167 (patch) | |
tree | 03c72b99e99ca71c4794e361713981e683b9c5c2 /Objects/classobject.c | |
parent | 4ab9b4c9adbd5ed42bc163033b3a01572b527ca3 (diff) | |
download | cpython-2a9096b5f9d90c6d90a9386c82214237ffc69167.zip cpython-2a9096b5f9d90c6d90a9386c82214237ffc69167.tar.gz cpython-2a9096b5f9d90c6d90a9386c82214237ffc69167.tar.bz2 |
New errors.
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r-- | Objects/classobject.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c index 6ed97a9..edc6070 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -108,7 +108,7 @@ newclassmemberobject(class) { register classmemberobject *cm; if (!is_classobject(class)) { - errno = EINVAL; + err_badcall(); return NULL; } cm = NEWOBJ(classmemberobject, &Classmembertype); @@ -148,14 +148,14 @@ classmember_getattr(cm, name) } v = class_getattr(cm->cm_class, name); if (v == NULL) - return v; /* class_getattr() has set errno */ + return v; /* class_getattr() has set the error */ if (is_funcobject(v)) { object *w = newclassmethodobject(v, (object *)cm); DECREF(v); return w; } DECREF(v); - errno = ESRCH; + err_setstr(NameError, name); return NULL; } @@ -205,7 +205,7 @@ newclassmethodobject(func, self) { register classmethodobject *cm; if (!is_funcobject(func)) { - errno = EINVAL; + err_badcall(); return NULL; } cm = NEWOBJ(classmethodobject, &Classmethodtype); @@ -223,7 +223,7 @@ classmethodgetfunc(cm) register object *cm; { if (!is_classmethodobject(cm)) { - errno = EINVAL; + err_badcall(); return NULL; } return ((classmethodobject *)cm)->cm_func; @@ -234,7 +234,7 @@ classmethodgetself(cm) register object *cm; { if (!is_classmethodobject(cm)) { - errno = EINVAL; + err_badcall(); return NULL; } return ((classmethodobject *)cm)->cm_self; |