Skip to content

Commit 06e1b63

Browse files
timfeldavidhewitt
andauthored
graalpy: Update checking for object not being NULL in src/err/mod.rs
Co-authored-by: David Hewitt <[email protected]>
1 parent 7321548 commit 06e1b63

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/err/mod.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,11 @@ impl PyErr {
868868
};
869869
// PyException_GetCause is documented as potentially returning PyNone, but only GraalPy seems to actually do that
870870
#[cfg(GraalPy)]
871-
if obj.is_some() && obj.is_none() {
871+
if let Some(cause) = &obj {
872+
if cause.is_none() {
873+
return None;
874+
}
875+
}
872876
return None;
873877
}
874878
obj.map(Self::from_value_bound)

0 commit comments

Comments
 (0)