Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PyO3 to 0.21 #17162

Merged
merged 9 commits into from
May 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix errors
  • Loading branch information
erikjohnston committed May 7, 2024
commit 07aab5c1d67447eebac9011a54fd40319bf182d4
6 changes: 3 additions & 3 deletions rust/src/acl/mod.rs
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ use std::net::Ipv4Addr;
use std::str::FromStr;

use anyhow::Error;
use pyo3::prelude::*;
use pyo3::{prelude::*, pybacked::PyBackedStr};
use regex::Regex;

use crate::push::utils::{glob_to_regex, GlobMatchType};
@@ -59,8 +59,8 @@ impl ServerAclEvaluator {
#[new]
pub fn py_new(
allow_ip_literals: bool,
allow: Vec<&str>,
deny: Vec<&str>,
allow: Vec<PyBackedStr>,
deny: Vec<PyBackedStr>,
) -> Result<Self, Error> {
let allow = allow
.iter()
5 changes: 3 additions & 2 deletions rust/src/events/internal_metadata.rs
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@ use anyhow::Context;
use log::warn;
use pyo3::{
exceptions::PyAttributeError,
pybacked::PyBackedStr,
pyclass, pymethods,
types::{PyDict, PyString},
Bound, IntoPy, PyAny, PyObject, PyResult, Python,
@@ -91,9 +92,9 @@ impl EventInternalMetadataData {
///
/// Returns `None` if the key is a valid but unrecognized string.
fn from_python_pair(key: &PyAny, value: &PyAny) -> PyResult<Option<Self>> {
let key_str: &str = key.extract()?;
let key_str: PyBackedStr = key.extract()?;

let e = match key_str {
let e = match &*key_str {
"out_of_band_membership" => EventInternalMetadataData::OutOfBandMembership(
value
.extract()