diff --git a/Cargo.toml b/Cargo.toml index 339944ce..769e4217 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ repository = "https://github.com/pyo3/pyo3" #documentation = "https://docs.rs/crate/pyo3/" categories = ["api-bindings", "development-tools::ffi"] license = "Apache-2.0" -exclude = [".gitignore", ".travis.yml", ".cargo/config", "appveyor.yml"] +exclude = ["/.gitignore", ".travis.yml", ".cargo/config", "appveyor.yml"] build = "build.rs" [badges] diff --git a/build.rs b/build.rs index 4e4cb45b..9ffb7642 100644 --- a/build.rs +++ b/build.rs @@ -175,7 +175,12 @@ fn run_python_script(interpreter: &str, script: &str) -> Result .args(&["-c", script]) .stderr(Stdio::inherit()) .output() - .map_err(|e| format!("Failed to run the python interpreter at {}: {}", interpreter, e))?; + .map_err(|e| { + format!( + "Failed to run the python interpreter at {}: {}", + interpreter, e + ) + })?; if !out.status.success() { return Err(format!("python script failed")); diff --git a/examples/rustapi_module/src/lib.rs b/examples/rustapi_module/src/lib.rs index 6c2ef34c..aadbb323 100644 --- a/examples/rustapi_module/src/lib.rs +++ b/examples/rustapi_module/src/lib.rs @@ -192,6 +192,13 @@ fn datetime_from_timestamp(py: Python, ts: f64, tz: Option<&PyTzInfo>) -> PyResu PyDateTime::from_timestamp(py, &args.to_object(py), &kwargs.to_object(py)) } +#[pyfunction] +fn issue_219() -> PyResult<()> { + let gil = Python::acquire_gil(); + let py = gil.python(); + Ok(()) +} + #[pymodinit] fn datetime(_py: Python, m: &PyModule) -> PyResult<()> { m.add_function(wrap_function!(make_date))?; @@ -213,5 +220,7 @@ fn datetime(_py: Python, m: &PyModule) -> PyResult<()> { m.add_function(wrap_function!(get_datetime_tuple_fold)); } + m.add_function(wrap_function!(issue_219))?; + Ok(()) } diff --git a/examples/rustapi_module/tests/test_datetime.py b/examples/rustapi_module/tests/test_datetime.py index ccfa6ae2..f41d5213 100644 --- a/examples/rustapi_module/tests/test_datetime.py +++ b/examples/rustapi_module/tests/test_datetime.py @@ -261,3 +261,5 @@ def test_delta_err(args, err_type): with pytest.raises(err_type): rdt.make_delta(*args) +def test_issue_219(): + rdt.issue_219() diff --git a/pyo3-derive-backend/Cargo.toml b/pyo3-derive-backend/Cargo.toml index 149edd7c..54eb52fb 100644 --- a/pyo3-derive-backend/Cargo.toml +++ b/pyo3-derive-backend/Cargo.toml @@ -12,4 +12,4 @@ license = "Apache-2.0" [dependencies] quote = "0.6.8" proc-macro2 = "0.4.19" -syn = { version = "0.15.3", features = ["full", "extra-traits"] } +syn = { version = "0.15.4", features = ["full", "extra-traits"] } diff --git a/pyo3cls/Cargo.toml b/pyo3cls/Cargo.toml index 293d5a29..5376d16a 100644 --- a/pyo3cls/Cargo.toml +++ b/pyo3cls/Cargo.toml @@ -15,5 +15,5 @@ proc-macro = true [dependencies] quote= "0.6.8" proc-macro2 = "0.4.19" -syn = { version = "0.15.3", features = ["full", "extra-traits"] } +syn = { version = "0.15.4", features = ["full", "extra-traits"] } pyo3-derive-backend = { path = "../pyo3-derive-backend", version = "=0.5.0" }