-
-
Notifications
You must be signed in to change notification settings - Fork 403
Open
Description
Hi, I am updating pendulum on debian side and now that we have pyo3 0.25 in debian, it needs to be compatible with that. After some time of juggling with the documentation and repeated testing, I got to get it compatible. But I am not sure how elegant or proper of a solution it is, so I am not proposing an MR yet. It just make everything works fine, all tests pass, the package bulds, and all that. Could you share your thoughts? One option is that you can take the patch and work on any improvements later.
-- a/rust/src/python/parsing.rs
+++ b/rust/src/python/parsing.rs
@@ -6,2 +6,3 @@
use pyo3::types::PyTime;
+use pyo3::conversion::IntoPyObjectExt;
@@ -33,4 +34,3 @@
Py::new(py, FixedTimezone::new(offset, datetime.tzname))?
- .to_object(py)
- .downcast_bound(py)?,
+ .into_pyobject(py).unwrap().downcast().unwrap()
),
@@ -38,3 +38,3 @@
- Ok(dt.to_object(py))
+ Ok(dt.into_py_any(py).unwrap())
}
@@ -53,3 +53,3 @@
- Ok(dt.to_object(py))
+ Ok(dt.into_py_any(py).unwrap())
}
@@ -64,3 +64,3 @@
- Ok(dt.to_object(py))
+ Ok(dt.into_py_any(py).unwrap())
}
@@ -76,4 +76,3 @@
Py::new(py, FixedTimezone::new(offset, datetime.tzname))?
- .to_object(py)
- .downcast_bound(py)?,
+ .into_pyobject(py).unwrap().downcast().unwrap(),
),
@@ -81,3 +80,3 @@
- Ok(dt.to_object(py))
+ Ok(dt.into_py_any(py).unwrap())
}
@@ -93,3 +92,3 @@
- Ok(dt.to_object(py))
+ Ok(dt.into_py_any(py).unwrap())
}
@@ -113,3 +112,3 @@
)?
- .to_object(py)),
+ .into_py_any(py).unwrap()),
(_, _, _) => Err(exceptions::PyValueError::new_err(
Metadata
Metadata
Assignees
Labels
No labels