Skip to content

Commit 3435f47

Browse files
committed
Remove non-standard sys.print_exception()
It already warned about it. Fixes #9451
1 parent d0776d3 commit 3435f47

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

py/modsys.c

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -170,29 +170,7 @@ static mp_obj_t mp_sys_exit(size_t n_args, const mp_obj_t *args) {
170170
}
171171
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_sys_exit_obj, 0, 1, mp_sys_exit);
172172

173-
static mp_obj_t mp_sys_print_exception(size_t n_args, const mp_obj_t *args) {
174-
// CIRCUITPY-CHANGE
175-
#if CIRCUITPY_WARNINGS
176-
warnings_warn(&mp_type_FutureWarning, MP_ERROR_TEXT("%q moved from %q to %q"), MP_QSTR_print_exception, MP_QSTR_sys, MP_QSTR_traceback);
177-
#endif
178-
179-
#if MICROPY_PY_IO && MICROPY_PY_SYS_STDFILES
180-
void *stream_obj = &mp_sys_stdout_obj;
181-
if (n_args > 1) {
182-
mp_get_stream_raise(args[1], MP_STREAM_OP_WRITE);
183-
stream_obj = MP_OBJ_TO_PTR(args[1]);
184-
}
185-
186-
mp_print_t print = {stream_obj, mp_stream_write_adaptor};
187-
mp_obj_print_exception(&print, args[0]);
188-
#else
189-
(void)n_args;
190-
mp_obj_print_exception(&mp_plat_print, args[0]);
191-
#endif
192-
193-
return mp_const_none;
194-
}
195-
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_sys_print_exception_obj, 1, 2, mp_sys_print_exception);
173+
// CIRCUITPY-CHANGE: Removed print_exception because it isn't in CPython.
196174

197175
#if MICROPY_PY_SYS_EXC_INFO
198176
static mp_obj_t mp_sys_exc_info(void) {
@@ -347,8 +325,6 @@ static const mp_rom_map_elem_t mp_module_sys_globals_table[] = {
347325
/*
348326
* Extensions to CPython
349327
*/
350-
351-
{ MP_ROM_QSTR(MP_QSTR_print_exception), MP_ROM_PTR(&mp_sys_print_exception_obj) },
352328
#if MICROPY_PY_SYS_ATEXIT
353329
{ MP_ROM_QSTR(MP_QSTR_atexit), MP_ROM_PTR(&mp_sys_atexit_obj) },
354330
#endif

0 commit comments

Comments
 (0)