Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion shared-bindings/traceback/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,18 @@ static void traceback_exception_common(bool is_print_exception, mp_print_t *prin
exc->traceback = (mp_obj_traceback_t *)&mp_const_empty_traceback_obj;
}

shared_module_traceback_print_exception(MP_OBJ_TO_PTR(value), print, limit);
nlr_buf_t nlr;
if (nlr_push(&nlr) == 0) {
shared_module_traceback_print_exception(MP_OBJ_TO_PTR(value), print, limit);
nlr_pop();
} else {
exc->traceback = trace_backup;
#if MICROPY_CPYTHON_EXCEPTION_CHAIN
exc->context = context_backup;
exc->cause = cause_backup;
#endif
nlr_jump(nlr.ret_val);
}
exc->traceback = trace_backup;
#if MICROPY_CPYTHON_EXCEPTION_CHAIN
exc->context = context_backup;
Expand Down
4 changes: 1 addition & 3 deletions shared-module/adafruit_bus_device/i2c_device/I2CDevice.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ void common_hal_adafruit_bus_device_i2cdevice_lock(adafruit_bus_device_i2cdevice

while (!mp_obj_is_true(success)) {
RUN_BACKGROUND_TASKS;
if (mp_hal_is_interrupted()) {
break;
}
mp_handle_pending(true);

success = mp_call_method_n_kw(0, 0, dest);
}
Expand Down
2 changes: 1 addition & 1 deletion shared-module/getpass/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mp_obj_t shared_module_getpass_getpass(const char *prompt, mp_print_t *print) {
if (print == NULL) {
mp_hal_stdout_tx_str(prompt);
} else {
mp_printf(print, prompt);
mp_print_str(print, prompt);
}

for (;;) {
Expand Down
7 changes: 4 additions & 3 deletions shared-module/os/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,9 @@ const char *common_hal_os_path_abspath(const char *path) {
}

void common_hal_os_chdir(const char *path) {
MP_STATE_VM(cwd_path) = common_hal_os_path_abspath(path);
const char *new_cwd = common_hal_os_path_abspath(path);
mp_obj_t path_out;
mp_vfs_mount_t *vfs = lookup_dir_path(MP_STATE_VM(cwd_path), &path_out);
MP_STATE_VM(vfs_cur) = vfs;
mp_vfs_mount_t *vfs = lookup_dir_path(new_cwd, &path_out);
if (vfs == MP_VFS_ROOT) {
// If we change to the root dir and a VFS is mounted at the root then
// we must change that VFS's current dir to the root dir so that any
Expand All @@ -163,6 +162,8 @@ void common_hal_os_chdir(const char *path) {
} else {
mp_vfs_proxy_call(vfs, MP_QSTR_chdir, 1, &path_out);
}
MP_STATE_VM(cwd_path) = new_cwd;
MP_STATE_VM(vfs_cur) = vfs;
}

mp_obj_t common_hal_os_getcwd(void) {
Expand Down
5 changes: 2 additions & 3 deletions shared-module/warnings/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ void common_hal_warnings_warn(const char *message, const mp_obj_type_t *category
return;
}
if (action == WARNINGS_ERROR) {
mp_raise_msg_str(category, message);
// Doesn't get here
return;
nlr_raise(mp_call_function_1(MP_OBJ_FROM_PTR(category),
mp_obj_new_str(message, strlen(message))));
}
mp_printf(MICROPY_ERROR_PRINTER, "%q: %s\n", category->name, message);
}
Expand Down
Loading