Remove use of unwrap (#1888)

* Remove use of unwrap

* Update changelog

* Update CHANGELOG.md

Co-authored-by: Mo Mirza <mo.mirza@iwoca.co.uk>
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
This commit is contained in:
Mo Mirza 2021-09-26 09:01:23 +01:00 committed by GitHub
parent 97fa3f739e
commit 4a34cc63a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -41,6 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix building with a conda environment on Windows. [#1873](https://github.com/PyO3/pyo3/pull/1873)
- Fix panic on Python 3.6 when calling `Python::with_gil` with Python initialized but threading not initialized. [#1874](https://github.com/PyO3/pyo3/pull/1874)
- Fix incorrect linking to version-specific DLL instead of `python3.dll` when cross-compiling to Windows with `abi3`. [#1880](https://github.com/PyO3/pyo3/pull/1880)
- Fix panic in generated `#[derive(FromPyObject)]` for enums. [#1888](https://github.com/PyO3/pyo3/pull/1888)
## [0.14.5] - 2021-09-05

View File

@ -63,7 +63,7 @@ impl<'a> Enum<'a> {
ok @ ::std::result::Result::Ok(_) => return ok,
::std::result::Result::Err(inner) => {
let py = ::pyo3::PyNativeType::py(obj);
err_reasons.push_str(&::std::format!("{}\n", inner.instance(py).str().unwrap()));
err_reasons.push_str(&::std::format!("{}\n", inner.instance(py).str()?));
}
}
);