py/objexcept: Fix hash of exc str created in mp_obj_new_exception_msg.

pull/4572/head
Tom Collins 2019-03-01 19:57:07 -05:00 zatwierdzone przez Damien George
rodzic f8f2724297
commit 2d644ac455
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -348,9 +348,9 @@ mp_obj_t mp_obj_new_exception_msg(const mp_obj_type_t *exc_type, const char *msg
// Create the string object and call mp_obj_exception_make_new to create the exception
o_str->base.type = &mp_type_str;
o_str->hash = qstr_compute_hash(o_str->data, o_str->len);
o_str->len = strlen(msg);
o_str->data = (const byte*)msg;
o_str->hash = qstr_compute_hash(o_str->data, o_str->len);
mp_obj_t arg = MP_OBJ_FROM_PTR(o_str);
return mp_obj_exception_make_new(exc_type, 1, 0, &arg);
}