Mercurial > cpython-lru_cache-weakref
diff Objects/moduleobject.c @ 1289:4d292c7857d4 legacy-trunk
Access checks now work, at least for instance data (not for methods
yet). The class is now passed to eval_code and stored in the current
frame. It is also stored in instance method objects. An "unbound"
instance method is now returned when a function is retrieved through
"classname.funcname", which when called passes the class to eval_code.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 20 May 1993 14:24:46 +0000 |
| parents | 9fed5726a36d |
| children | ac3c80abbf43 |
line wrap: on
line diff
--- a/Objects/moduleobject.c Wed May 19 14:50:45 1993 +0000 +++ b/Objects/moduleobject.c Thu May 20 14:24:46 1993 +0000 @@ -25,6 +25,7 @@ /* Module object implementation */ #include "allobjects.h" +#include "ceval.h" typedef struct { OB_HEAD @@ -111,7 +112,7 @@ err_setstr(AttributeError, name); else { if (is_accessobject(res)) - res = getaccessvalue(res, (object *)NULL); + res = getaccessvalue(res, getclass()); else INCREF(res); } @@ -134,7 +135,7 @@ } ac = dictlookup(m->md_dict, name); if (ac != NULL && is_accessobject(ac)) - return setaccessvalue(ac, (object *)NULL, v); + return setaccessvalue(ac, getclass(), v); if (v == NULL) { int rv = dictremove(m->md_dict, name); if (rv < 0)
