Skip to content

Commit 1fccda0

Browse files
committed
py/objexcept: Rename mp_obj_new_exception_msg_varg2 to ..._vlist.
Follow up to recent commit ad7213d, the name "varg2" is misleading, vlist describes better that the argument is a va_list. This name also matches CircuitPython, which already has such helper functions.
1 parent cddb90e commit 1fccda0

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

py/obj.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ mp_obj_t mp_obj_new_exception_args(const mp_obj_type_t *exc_type, size_t n_args,
708708
mp_obj_t mp_obj_new_exception_msg(const mp_obj_type_t *exc_type, const char *msg);
709709
mp_obj_t mp_obj_new_exception_msg_varg(const mp_obj_type_t *exc_type, const char *fmt, ...); // counts args by number of % symbols in fmt, excluding %%; can only handle void* sizes (ie no float/double!)
710710
#ifdef va_start
711-
mp_obj_t mp_obj_new_exception_msg_varg2(const mp_obj_type_t *exc_type, const char *fmt, va_list arg); // counts args by number of % symbols in fmt, excluding %%; can only handle void* sizes (ie no float/double!)
711+
mp_obj_t mp_obj_new_exception_msg_vlist(const mp_obj_type_t *exc_type, const char *fmt, va_list arg); // same fmt restrictions as above
712712
#endif
713713
mp_obj_t mp_obj_new_fun_bc(mp_obj_t def_args, mp_obj_t def_kw_args, const byte *code, const mp_uint_t *const_table);
714714
mp_obj_t mp_obj_new_fun_native(mp_obj_t def_args_in, mp_obj_t def_kw_args, const void *fun_data, const mp_uint_t *const_table);

py/objexcept.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,12 +387,12 @@ STATIC void exc_add_strn(void *data, const char *str, size_t len) {
387387
mp_obj_t mp_obj_new_exception_msg_varg(const mp_obj_type_t *exc_type, const char *fmt, ...) {
388388
va_list args;
389389
va_start(args, fmt);
390-
mp_obj_t exc = mp_obj_new_exception_msg_varg2(exc_type, fmt, args);
390+
mp_obj_t exc = mp_obj_new_exception_msg_vlist(exc_type, fmt, args);
391391
va_end(args);
392392
return exc;
393393
}
394394

395-
mp_obj_t mp_obj_new_exception_msg_varg2(const mp_obj_type_t *exc_type, const char *fmt, va_list args) {
395+
mp_obj_t mp_obj_new_exception_msg_vlist(const mp_obj_type_t *exc_type, const char *fmt, va_list args) {
396396
assert(fmt != NULL);
397397

398398
// Check that the given type is an exception type

py/runtime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1494,7 +1494,7 @@ NORETURN void mp_raise_msg(const mp_obj_type_t *exc_type, const char *msg) {
14941494
NORETURN void mp_raise_msg_varg(const mp_obj_type_t *exc_type, const char *fmt, ...) {
14951495
va_list args;
14961496
va_start(args, fmt);
1497-
mp_obj_t exc = mp_obj_new_exception_msg_varg2(exc_type, fmt, args);
1497+
mp_obj_t exc = mp_obj_new_exception_msg_vlist(exc_type, fmt, args);
14981498
va_end(args);
14991499
nlr_raise(exc);
15001500
}

0 commit comments

Comments
 (0)