diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-05-11 03:12:36 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-05-11 03:33:19 +0300 |
commit | 9511f60f016547ab00f634d451c230351bd8b225 (patch) | |
tree | c4bb8fcc41a0d63f1434943b8b9134c292666b43 /py/runtime.c | |
parent | 69f3eb2c9688752d674254c3f4158cae688053be (diff) |
py: Don't try to "bind" types store as attributes of objects.
This was hit when trying to make urlparse.py from stdlib run. Took
quite some time to debug.
TODO: Reconsile bound method creation process better, maybe callable is
to generic type to bind at all?
Diffstat (limited to 'py/runtime.c')
-rw-r--r-- | py/runtime.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/py/runtime.c b/py/runtime.c index 1479d8cba..a2de2d75b 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -840,6 +840,9 @@ void mp_load_method_maybe(mp_obj_t base, qstr attr, mp_obj_t *dest) { // return a bound method, with self being the type of this object dest[0] = ((mp_obj_static_class_method_t*)elem->value)->fun; dest[1] = mp_obj_get_type(base); + } else if (MP_OBJ_IS_TYPE(elem->value, &mp_type_type)) { + // Don't try to bind types + dest[0] = elem->value; } else if (mp_obj_is_callable(elem->value)) { // return a bound method, with self being this object dest[0] = elem->value; |