Skip to content

Commit

Permalink
libcst_native: add optional signature
Browse files Browse the repository at this point in the history
Newer versions of pyo3 warn about missing signatures
  • Loading branch information
jelmer committed Sep 9, 2024
1 parent 5618e82 commit 06443e1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions native/libcst/src/py.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use pyo3::prelude::*;
#[pyo3(name = "native")]
pub fn libcst_native(_py: Python, m: &Bound<PyModule>) -> PyResult<()> {
#[pyfn(m)]
#[pyo3(signature = (source, encoding=None))]
fn parse_module(source: String, encoding: Option<&str>) -> PyResult<PyObject> {
let m = crate::parse_module(source.as_str(), encoding)?;
Python::with_gil(|py| m.try_into_py(py))
Expand Down

0 comments on commit 06443e1

Please sign in to comment.