Mercurial > cpython-lru_cache-weakref
diff Objects/moduleobject.c @ 14:874c8fd565fa legacy-trunk
New error handling in getattr().
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Sun, 14 Oct 1990 20:03:32 +0000 |
| parents | fc6fcd7df4f7 |
| children | 32639878d16b |
line wrap: on
line diff
--- a/Objects/moduleobject.c Sun Oct 14 20:03:07 1990 +0000 +++ b/Objects/moduleobject.c Sun Oct 14 20:03:32 1990 +0000 @@ -8,6 +8,7 @@ #include "dictobject.h" #include "moduleobject.h" #include "objimpl.h" +#include "errors.h" typedef struct { OB_HEAD @@ -94,10 +95,8 @@ char *name; { object *res = dictlookup(m->md_dict, name); - if (res == NULL) { - if (errno == ENOENT) - errno = ESRCH; - } + if (res == NULL) + err_setstr(NameError, name); else INCREF(res); return res;
