Skip to content

Commit

Permalink
Merge pull request #5608 from microDev1/traceback
Browse files Browse the repository at this point in the history
Traceback object init - set it to empty only if null
  • Loading branch information
dhalbert authored Nov 22, 2021
2 parents 932131b + ed9595a commit 40a00c1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions py/objexcept.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 40a00c1

Please sign in to comment.