Merge pull request #5608 from microDev1/traceback

Traceback object init - set it to empty only if null
This commit is contained in:
Dan Halbert 2021-11-22 12:38:18 -05:00 committed by GitHub
commit 40a00c1e53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -558,11 +558,10 @@ void mp_obj_exception_add_traceback(mp_obj_t self_in, qstr file, size_t line, qs
if (self->traceback == NULL) {
self->traceback = &MP_STATE_VM(mp_emergency_traceback_obj);
}
// populate traceback object
*self->traceback = mp_const_empty_traceback_obj;
}
// populate traceback object
*self->traceback = mp_const_empty_traceback_obj;
// append the provided traceback info to traceback data
// if memory allocation fails (eg because gc is locked), just return
if (self->traceback->data == NULL) {