Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Collapse nested if in asyncio traceback restore
Assisted-by: Grok:grok-4.6
  • Loading branch information
youknowone committed Sep 19, 2026
commit b8f604bac1b501f7a6c77e2f347855e33001aa9d
16 changes: 8 additions & 8 deletions crates/stdlib/src/_asyncio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,10 @@ pub(crate) mod _asyncio {
let exc: PyBaseExceptionRef = exc.downcast().unwrap();
// Restore the original traceback to prevent traceback accumulation
let fut_exception_tb = self.fut_exception_tb.read().clone();
if let Some(tb) = fut_exception_tb {
if let Ok(tb) = tb.downcast::<PyTraceback>() {
exc.set_traceback(Some(tb));
}
if let Some(tb) = fut_exception_tb
&& let Ok(tb) = tb.downcast::<PyTraceback>()
{
exc.set_traceback(Some(tb));
}
Err(exc)
} else {
Expand Down Expand Up @@ -1278,10 +1278,10 @@ pub(crate) mod _asyncio {
let exc: PyBaseExceptionRef = exc.downcast().unwrap();
// Restore the original traceback to prevent traceback accumulation
let fut_exception_tb = self.base.fut_exception_tb.read().clone();
if let Some(tb) = fut_exception_tb {
if let Ok(tb) = tb.downcast::<PyTraceback>() {
exc.set_traceback(Some(tb));
}
if let Some(tb) = fut_exception_tb
&& let Ok(tb) = tb.downcast::<PyTraceback>()
{
exc.set_traceback(Some(tb));
}

Err(exc)
Expand Down