TODO: This function should do nothing on verbose mode. TODO: Fix this function after making PyTraceback.next mutable
(vm: &VirtualMachine, exc: &Py<PyBaseException>)
| 248 | // TODO: This function should do nothing on verbose mode. |
| 249 | // TODO: Fix this function after making PyTraceback.next mutable |
| 250 | pub fn remove_importlib_frames(vm: &VirtualMachine, exc: &Py<PyBaseException>) { |
| 251 | if vm.state.config.settings.verbose != 0 { |
| 252 | return; |
| 253 | } |
| 254 | |
| 255 | let always_trim = exc.fast_isinstance(vm.ctx.exceptions.import_error); |
| 256 | |
| 257 | if let Some(tb) = exc.__traceback__() { |
| 258 | let trimmed_tb = remove_importlib_frames_inner(vm, Some(tb), always_trim).0; |
| 259 | exc.set_traceback_typed(trimmed_tb); |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | /// Get origin path from a module spec, checking has_location first. |
| 264 | pub(crate) fn get_spec_file_origin( |
no test coverage detected