Skip to content

Commit

Permalink
graalpy: Update checking for object not being NULL in src/err/mod.rs
Browse files Browse the repository at this point in the history
Co-authored-by: David Hewitt <mail@davidhewitt.dev>
  • Loading branch information
timfel and davidhewitt committed Mar 25, 2024
1 parent 7321548 commit 06e1b63
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/err/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,11 @@ impl PyErr {
};
// PyException_GetCause is documented as potentially returning PyNone, but only GraalPy seems to actually do that
#[cfg(GraalPy)]
if obj.is_some() && obj.is_none() {
if let Some(cause) = &obj {
if cause.is_none() {
return None;
}
}
return None;
}
obj.map(Self::from_value_bound)
Expand Down

0 comments on commit 06e1b63

Please sign in to comment.