Skip to content

Commit

Permalink
pyo3: Update to 0.22, support Python 3.13
Browse files Browse the repository at this point in the history
Merges: #6
  • Loading branch information
chrysn committed Jun 26, 2024
2 parents 02d68b3 + 862b092 commit 30cfa33
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 148 deletions.
181 changes: 36 additions & 145 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ crate-type = ["cdylib"]

[dependencies]
cbor-diag-rs = { package = "cbor-diag", version = "0.1.11" }
pyo3 = "0.18.1"
pyo3 = "0.22"
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fn diag2cbor(py: Python<'_>, diagnostic: &str) -> PyResult<PyObject> {
cbor_diag_rs::Error::Todo(s) => pyo3::exceptions::PyValueError::new_err(s),
})?
.to_bytes();
Ok(PyBytes::new(py, &bytes).into())
Ok(PyBytes::new_bound(py, &bytes).into())
}

/// Given a byte string containing encoded CBOR, produce some diagnostic notation.
Expand Down Expand Up @@ -57,7 +57,7 @@ fn cbor2diag(_py: Python<'_>, encoded: &[u8], pretty: bool) -> PyResult<String>
/// .. _RFC8949: https://www.rfc-editor.org/rfc/rfc8949
/// .. _cbor2: https://pypi.org/project/cbor2/
#[pymodule]
fn _cbor_diag(_py: Python, m: &PyModule) -> PyResult<()> {
fn _cbor_diag(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_function(wrap_pyfunction!(diag2cbor, m)?)?;
m.add_function(wrap_pyfunction!(cbor2diag, m)?)?;
Ok(())
Expand Down

0 comments on commit 30cfa33

Please sign in to comment.