Skip to content

Commit

Permalink
deps(pyo3): update to 0.21.2
Browse files Browse the repository at this point in the history
  • Loading branch information
notmandatory committed Jun 4, 2024
1 parent dd3e6d9 commit d70bd9a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ readme = "README.md"
bitcoin = { version = "0.31.0", features = ["serde", "base64"] }
serde = { version = "^1.0", features = ["derive"] }
serde_json = { version = "^1.0" }
pyo3 = { version = "0.15.1", features = ["auto-initialize"] }
pyo3 = { version = "0.21.2", features = ["auto-initialize"] }

miniscript = { version = "11.0", features = ["serde"], optional = true }

Expand Down
7 changes: 4 additions & 3 deletions src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ struct HWILib {
impl HWILib {
pub fn initialize() -> Result<Self, Error> {
Python::with_gil(|py| {
let commands: Py<PyModule> = PyModule::import(py, "hwilib.commands")?.into();
let json_dumps: Py<PyAny> = PyModule::import(py, "json")?.getattr("dumps")?.into();
let commands: Py<PyModule> = PyModule::import_bound(py, "hwilib.commands")?.into();
let json_dumps: Py<PyAny> =
PyModule::import_bound(py, "json")?.getattr("dumps")?.into();
Ok(HWILib {
commands,
json_dumps,
Expand Down Expand Up @@ -497,7 +498,7 @@ impl HWIClient {
pub fn get_version() -> Option<String> {
Python::with_gil(|py| {
Some(
PyModule::import(py, "hwilib")
PyModule::import_bound(py, "hwilib")
.ok()?
.getattr("__version__")
.expect("Should have a __version__")
Expand Down
5 changes: 3 additions & 2 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use serde::{Deserialize, Deserializer};

#[cfg(feature = "miniscript")]
use miniscript::{Descriptor, DescriptorPublicKey};
use pyo3::prelude::PyAnyMethods;

use crate::error::{Error, ErrorCode};

Expand Down Expand Up @@ -113,7 +114,7 @@ pub enum HWIAddressType {

impl IntoPy<PyObject> for HWIAddressType {
fn into_py(self, py: pyo3::Python) -> PyObject {
let addrtype = PyModule::import(py, "hwilib.common")
let addrtype = PyModule::import_bound(py, "hwilib.common")
.unwrap()
.getattr("AddressType")
.unwrap();
Expand All @@ -133,7 +134,7 @@ impl IntoPy<PyObject> for HWIChain {
fn into_py(self, py: pyo3::Python) -> PyObject {
use bitcoin::Network::*;

let chain = PyModule::import(py, "hwilib.common")
let chain = PyModule::import_bound(py, "hwilib.common")
.unwrap()
.getattr("Chain")
.unwrap();
Expand Down

0 comments on commit d70bd9a

Please sign in to comment.