Skip to content

Commit f0b2972

Browse files
committed
py, objexcept: Only check for locked gc if gc is enabled.
1 parent f065344 commit f0b2972

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

py/objexcept.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,10 +336,13 @@ void mp_obj_exception_clear_traceback(mp_obj_t self_in) {
336336
}
337337

338338
void mp_obj_exception_add_traceback(mp_obj_t self_in, qstr file, machine_uint_t line, qstr block) {
339+
#if MICROPY_ENABLE_GC
339340
if (gc_is_locked()) {
340341
// We can't allocate memory, so don't bother to try
341342
return;
342343
}
344+
#endif
345+
343346
GET_NATIVE_EXCEPTION(self, self_in);
344347

345348
// for traceback, we are just using the list object for convenience, it's not really a list of Python objects

0 commit comments

Comments
 (0)