Use write_unraisable to report errors loading type objects for ABC checks.
This commit is contained in:
parent
c1f4db0a9b
commit
3c97167fd1
|
@ -256,8 +256,10 @@ impl PyTypeCheck for PyMapping {
|
|||
PyDict::is_type_of(object)
|
||||
|| get_mapping_abc(object.py())
|
||||
.and_then(|abc| object.is_instance(abc))
|
||||
// TODO: surface errors in this chain to the user
|
||||
.unwrap_or(false)
|
||||
.unwrap_or_else(|err| {
|
||||
err.write_unraisable(object.py(), Some(object));
|
||||
false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -540,8 +540,10 @@ impl PyTypeCheck for PySequence {
|
|||
|| PyTuple::is_type_of(object)
|
||||
|| get_sequence_abc(object.py())
|
||||
.and_then(|abc| object.is_instance(abc))
|
||||
// TODO: surface errors in this chain to the user
|
||||
.unwrap_or(false)
|
||||
.unwrap_or_else(|err| {
|
||||
err.write_unraisable(object.py(), Some(object));
|
||||
false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue