From: Peter Michael Green <plugwash@debian.org>
Date: Sun, 25 Jun 2023 03:03:03 +0100
Subject: Upgrade-to-pyo3-0.19

This patch is based on the upstream commit described below, adapted for use
in the Debian package by Peter Michael Green.

commit b1cfa3adef986ef3466b080263911e8d79ec6141
Author: Alex Gaynor <alex.gaynor@gmail.com>
Date:   Wed May 31 16:27:10 2023 -0400

    pyo3 0.19 (#8999)
    
    * Bump pyo3 from 0.18.3 to 0.19.0 in /src/rust
    
    Bumps [pyo3](https://github.com/pyo3/pyo3) from 0.18.3 to 0.19.0.
    - [Release notes](https://github.com/pyo3/pyo3/releases)
    - [Changelog](https://github.com/PyO3/pyo3/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/pyo3/pyo3/compare/v0.18.3...v0.19.0)
    
    ---
    updated-dependencies:
    - dependency-name: pyo3
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    * pyo3 0.19
    
    ---------
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
 src/rust/Cargo.toml             | 2 +-
 src/rust/src/x509/crl.rs        | 2 +-
 src/rust/src/x509/extensions.rs | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

--- a/src/rust/Cargo.toml
+++ b/src/rust/Cargo.toml
@@ -9,7 +9,7 @@
 
 [dependencies]
 once_cell = "1"
-pyo3 = { version = "0.18", features = ["abi3-py37"] }
+pyo3 = { version = "0.20", features = ["abi3-py37"] }
 asn1 = { version = "0.15.2", default-features = false }
 cryptography-cffi = { path = "cryptography-cffi" }
 cryptography-x509 = { path = "cryptography-x509" }
--- a/src/rust/src/x509/crl.rs
+++ b/src/rust/src/x509/crl.rs
@@ -145,7 +145,7 @@
             revoked_certs
         });
 
-        if idx.is_instance_of::<pyo3::types::PySlice>()? {
+        if idx.is_instance_of::<pyo3::types::PySlice>() {
             let indices = idx
                 .downcast::<pyo3::types::PySlice>()?
                 .indices(self.len().try_into().unwrap())?;
--- a/src/rust/src/x509/extensions.rs
+++ b/src/rust/src/x509/extensions.rs
@@ -211,7 +211,7 @@
             let mut qualifiers = vec![];
             for py_qualifier in py_policy_qualifiers.iter()? {
                 let py_qualifier = py_qualifier?;
-                let qualifier = if py_qualifier.is_instance_of::<pyo3::types::PyString>()? {
+                let qualifier = if py_qualifier.is_instance_of::<pyo3::types::PyString>() {
                     let cps_uri = match asn1::IA5String::new(py_qualifier.extract()?) {
                         Some(s) => s,
                         None => {
--- a/src/rust/cryptography-cffi/Cargo.toml
+++ b/src/rust/cryptography-cffi/Cargo.toml
@@ -8,7 +8,7 @@
 rust-version = "1.56.0"
 
 [dependencies]
-pyo3 = { version = "0.18", features = ["abi3-py37"] }
+pyo3 = { version = "0.20", features = ["abi3-py37"] }
 openssl-sys = "0.9.88"
 
 [build-dependencies]
