(module: &PyObject, vm: &VirtualMachine)
| 9694 | } |
| 9695 | |
| 9696 | fn is_module_initializing(module: &PyObject, vm: &VirtualMachine) -> bool { |
| 9697 | let Ok(spec) = module.get_attr(&vm.ctx.new_str("__spec__"), vm) else { |
| 9698 | return false; |
| 9699 | }; |
| 9700 | if vm.is_none(&spec) { |
| 9701 | return false; |
| 9702 | } |
| 9703 | let Ok(initializing_attr) = spec.get_attr(&vm.ctx.new_str("_initializing"), vm) else { |
| 9704 | return false; |
| 9705 | }; |
| 9706 | initializing_attr.try_to_bool(vm).unwrap_or(false) |
| 9707 | } |
| 9708 | |
| 9709 | fn expect_unchecked<T: fmt::Debug>(optional: Option<T>, err_msg: &'static str) -> T { |
| 9710 | if cfg!(debug_assertions) { |
no test coverage detected