@@ -264,7 +264,7 @@ mp_int_t mp_obj_get_int(mp_const_obj_t arg) {
264
264
return mp_obj_int_get_checked (arg );
265
265
} else {
266
266
if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE ) {
267
- mp_raise_TypeError (translate ("can't convert to int" ) );
267
+ mp_raise_TypeError_varg (translate ("can't convert to %q" ), MP_QSTR_int );
268
268
} else {
269
269
mp_raise_TypeError_varg (
270
270
translate ("can't convert %q to %q" ), mp_obj_get_type_qstr (arg ), MP_QSTR_int );
@@ -327,7 +327,7 @@ mp_float_t mp_obj_get_float(mp_obj_t arg) {
327
327
328
328
if (!mp_obj_get_float_maybe (arg , & val )) {
329
329
if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE ) {
330
- mp_raise_TypeError (translate ("can't convert to float" ) );
330
+ mp_raise_TypeError_varg (translate ("can't convert to %q" ), MP_QSTR_float );
331
331
} else {
332
332
mp_raise_TypeError_varg (
333
333
translate ("can't convert %q to %q" ), mp_obj_get_type_qstr (arg ), MP_QSTR_float );
@@ -360,7 +360,7 @@ void mp_obj_get_complex(mp_obj_t arg, mp_float_t *real, mp_float_t *imag) {
360
360
mp_obj_complex_get (arg , real , imag );
361
361
} else {
362
362
if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE ) {
363
- mp_raise_TypeError (translate ("can't convert to complex" ) );
363
+ mp_raise_TypeError_varg (translate ("can't convert to %q" ), MP_QSTR_complex );
364
364
} else {
365
365
mp_raise_TypeError_varg (
366
366
translate ("can't convert %q to %q" ), mp_obj_get_type_qstr (arg ), MP_QSTR_complex );
0 commit comments