We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 231b3b5 commit 8e26a28Copy full SHA for 8e26a28
crates/vm/src/vm/mod.rs
@@ -550,6 +550,16 @@ impl VirtualMachine {
550
551
#[cold]
552
pub fn run_unraisable(&self, e: PyBaseExceptionRef, msg: Option<String>, object: PyObjectRef) {
553
+ // Suppress unraisable exceptions during interpreter finalization.
554
+ // daemon thread exceptions and __del__ errors are silently ignored during shutdown.
555
+ if self
556
+ .state
557
+ .finalizing
558
+ .load(std::sync::atomic::Ordering::Acquire)
559
+ {
560
+ return;
561
+ }
562
+
563
let sys_module = self.import("sys", 0).unwrap();
564
let unraisablehook = sys_module.get_attr("unraisablehook", self).unwrap();
565
0 commit comments