mirror of
https://github.com/micropython/micropython.git
synced 2025-08-08 03:31:53 +02:00
py: Use shorter, static error msgs when ERROR_REPORTING_TERSE enabled.
Going from MICROPY_ERROR_REPORTING_NORMAL to MICROPY_ERROR_REPORTING_TERSE now saves 2020 bytes ROM for ARM Thumb2, and 2200 bytes ROM for 32-bit x86. This is about a 2.5% code size reduction for bare-arm.
This commit is contained in:
@@ -138,7 +138,13 @@ overflow:
|
||||
}
|
||||
|
||||
value_error:
|
||||
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "invalid syntax for integer with base %d: '%s'", base, str));
|
||||
if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) {
|
||||
nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError,
|
||||
"invalid syntax for integer"));
|
||||
} else {
|
||||
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError,
|
||||
"invalid syntax for integer with base %d: '%s'", base, str));
|
||||
}
|
||||
}
|
||||
|
||||
typedef enum {
|
||||
|
Reference in New Issue
Block a user