Skip to content

Commit

Permalink
fix case of checking truthiness of NotImplemented
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed May 22, 2024
1 parent 2415f42 commit 7978cb8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/serializers/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ fn map_negative_index<'py>(value: &Bound<'py, PyAny>, len: Option<usize>) -> PyR
.unwrap_or_else(|_| value.clone())),
None => {
// check that it's not negative
let negative = value.call_method1(intern!(py, "__lt__"), (0,))?.is_truthy()?;
if negative {
let negative = value.lt(0);
if matches!(negative, Ok(true)) {
Err(PyValueError::new_err(
"Negative indices cannot be used to exclude items on unsized iterables",
))
Expand Down

0 comments on commit 7978cb8

Please sign in to comment.