@@ -104,7 +104,7 @@ mp_obj_t mp_alloc_emergency_exception_buf(mp_obj_t size_in) {
104
104
#endif
105
105
#endif // MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF
106
106
107
- STATIC mp_obj_exception_t * get_native_exception (mp_obj_t self_in ) {
107
+ mp_obj_exception_t * mp_obj_exception_get_native (mp_obj_t self_in ) {
108
108
assert (mp_obj_is_exception_instance (self_in ));
109
109
if (mp_obj_is_native_exception_instance (self_in )) {
110
110
return MP_OBJ_TO_PTR (self_in );
@@ -206,7 +206,7 @@ mp_obj_t mp_obj_exception_make_new(const mp_obj_type_t *type, size_t n_args, siz
206
206
207
207
// Get exception "value" - that is, first argument, or None
208
208
mp_obj_t mp_obj_exception_get_value (mp_obj_t self_in ) {
209
- mp_obj_exception_t * self = get_native_exception (self_in );
209
+ mp_obj_exception_t * self = mp_obj_exception_get_native (self_in );
210
210
if (self -> args -> len == 0 ) {
211
211
return mp_const_none ;
212
212
} else {
@@ -543,14 +543,14 @@ bool mp_obj_exception_match(mp_obj_t exc, mp_const_obj_t exc_type) {
543
543
// traceback handling functions
544
544
545
545
void mp_obj_exception_clear_traceback (mp_obj_t self_in ) {
546
- mp_obj_exception_t * self = get_native_exception (self_in );
546
+ mp_obj_exception_t * self = mp_obj_exception_get_native (self_in );
547
547
// just set the traceback to the empty traceback object
548
548
// we don't want to call any memory management functions here
549
549
self -> traceback = (mp_obj_traceback_t * )& mp_const_empty_traceback_obj ;
550
550
}
551
551
552
552
void mp_obj_exception_add_traceback (mp_obj_t self_in , qstr file , size_t line , qstr block ) {
553
- mp_obj_exception_t * self = get_native_exception (self_in );
553
+ mp_obj_exception_t * self = mp_obj_exception_get_native (self_in );
554
554
555
555
// Try to allocate memory for the traceback, with fallback to emergency traceback object
556
556
if (self -> traceback == NULL || self -> traceback == (mp_obj_traceback_t * )& mp_const_empty_traceback_obj ) {
@@ -612,7 +612,7 @@ void mp_obj_exception_add_traceback(mp_obj_t self_in, qstr file, size_t line, qs
612
612
}
613
613
614
614
void mp_obj_exception_get_traceback (mp_obj_t self_in , size_t * n , size_t * * values ) {
615
- mp_obj_exception_t * self = get_native_exception (self_in );
615
+ mp_obj_exception_t * self = mp_obj_exception_get_native (self_in );
616
616
617
617
if (self -> traceback == NULL ) {
618
618
* n = 0 ;
0 commit comments