mp_obj_equal(): Instead of assert(), throw NotImplementedError.

With a nice traceback, helps debugging much better.
This commit is contained in:
Paul Sokolovsky 2014-02-10 19:43:41 +02:00
parent 0a25aba046
commit 4e836fb4ea
1 changed files with 3 additions and 3 deletions

View File

@ -132,9 +132,9 @@ bool mp_obj_equal(mp_obj_t o1, mp_obj_t o2) {
return r == mp_const_true ? true : false;
}
}
// TODO: Debugging helper
printf("Equality for '%s' and '%s' types not yet implemented\n", mp_obj_get_type_str(o1), mp_obj_get_type_str(o2));
assert(0);
nlr_jump(mp_obj_new_exception_msg_varg(MP_QSTR_NotImplementedError,
"Equality for '%s' and '%s' types not yet implemented", mp_obj_get_type_str(o1), mp_obj_get_type_str(o2)));
return false;
}
}