Skip to content

Commit

Permalink
Bump PyO3 to 0.20 to fix backtraces (#20517)
Browse files Browse the repository at this point in the history
Fixes #20460. Caused by PyO3/pyo3#3327.

Nothing in the [changelog](https://pyo3.rs/v0.20.0/changelog.html)
stands out to me as a super-immediate need so doing the minimal upgrade.
  • Loading branch information
tgolsson authored Feb 12, 2024
1 parent 3c11838 commit e30da1c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
2 changes: 2 additions & 0 deletions src/python/pants/engine/internals/scheduler_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@ def test_trace_includes_nested_exception_traceback() -> None:
return await Get(SomeOutput, SomeInput(outer_input.s))
File LOCATION-INFO, in __await__
result = yield self
File LOCATION-INFO, in raise_an_exception
raise Exception(some_input.s)
Exception: asdf
The above exception was the direct cause of the following exception:
Expand Down
42 changes: 20 additions & 22 deletions src/rust/engine/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/rust/engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ prodash = { git = "https://github.com/stuhood/prodash", rev = "stuhood/raw-messa
prost = "0.12"
prost-build = "0.12"
prost-types = "0.12"
pyo3 = "0.19"
pyo3 = "0.20"
rand = "0.8"
regex = "1"
rlimit = "0.8"
Expand Down
4 changes: 2 additions & 2 deletions src/rust/engine/src/externs/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ pub struct PyMergeDigests(pub Vec<DirectoryDigest>);
#[pymethods]
impl PyMergeDigests {
#[new]
fn __new__(digests: &PyAny, py: Python) -> PyResult<Self> {
let digests: PyResult<Vec<DirectoryDigest>> = PyIterator::from_object(py, digests)?
fn __new__(digests: &PyAny, _py: Python) -> PyResult<Self> {
let digests: PyResult<Vec<DirectoryDigest>> = PyIterator::from_object(digests)?
.map(|v| {
let py_digest = v?.extract::<PyDigest>()?;
Ok(py_digest.0)
Expand Down
2 changes: 1 addition & 1 deletion src/rust/engine/src/interning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl Interns {
let (id, type_id): (u64, TypeId) = {
let v = v.as_ref(py);
let keys = self.keys.as_ref(py);
let id: u64 = if let Some(key) = keys.get_item(v) {
let id: u64 = if let Some(key) = keys.get_item(v)? {
key.extract()?
} else {
let id = self.id_generator.fetch_add(1, atomic::Ordering::Relaxed);
Expand Down

0 comments on commit e30da1c

Please sign in to comment.