diff options
| author | Damien George <damien.p.george@gmail.com> | 2014-03-31 16:28:58 +0100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2014-03-31 16:28:58 +0100 |
| commit | 43e92cfb521db55fb2d0001388c0e3a532405b50 (patch) | |
| tree | e7f69bc029e9236a3adfdc228bdaa62102491b82 /py/objtype.c | |
| parent | 15d18069c50f7c02cb71417f3c4ffddff335fe70 (diff) | |
| parent | e566670153adc1d995206eaf3a9e606000a789d4 (diff) | |
Merge branch 'master' of github.com:micropython/micropython
Diffstat (limited to 'py/objtype.c')
| -rw-r--r-- | py/objtype.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/py/objtype.c b/py/objtype.c index 127512480..ee3ce12ab 100644 --- a/py/objtype.c +++ b/py/objtype.c @@ -297,6 +297,10 @@ STATIC mp_obj_t type_call(mp_obj_t self_in, uint n_args, uint n_kw, const mp_obj STATIC void type_load_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { assert(MP_OBJ_IS_TYPE(self_in, &mp_type_type)); mp_obj_type_t *self = self_in; + if (attr == MP_QSTR___name__) { + dest[0] = MP_OBJ_NEW_QSTR(self->name); + return; + } mp_obj_t member = mp_obj_class_lookup(self, attr); if (member != MP_OBJ_NULL) { // check if the methods are functions, static or class methods |
