Skip to content

Commit e30da1c

Browse files
authored
Bump PyO3 to 0.20 to fix backtraces (#20517)
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.
1 parent 3c11838 commit e30da1c

File tree

5 files changed

+26
-26
lines changed

5 files changed

+26
-26
lines changed

src/python/pants/engine/internals/scheduler_test.py

+2
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,8 @@ def test_trace_includes_nested_exception_traceback() -> None:
481481
return await Get(SomeOutput, SomeInput(outer_input.s))
482482
File LOCATION-INFO, in __await__
483483
result = yield self
484+
File LOCATION-INFO, in raise_an_exception
485+
raise Exception(some_input.s)
484486
Exception: asdf
485487
486488
The above exception was the direct cause of the following exception:

src/rust/engine/Cargo.lock

+20-22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/rust/engine/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ prodash = { git = "https://github.com/stuhood/prodash", rev = "stuhood/raw-messa
289289
prost = "0.12"
290290
prost-build = "0.12"
291291
prost-types = "0.12"
292-
pyo3 = "0.19"
292+
pyo3 = "0.20"
293293
rand = "0.8"
294294
regex = "1"
295295
rlimit = "0.8"

src/rust/engine/src/externs/fs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ pub struct PyMergeDigests(pub Vec<DirectoryDigest>);
257257
#[pymethods]
258258
impl PyMergeDigests {
259259
#[new]
260-
fn __new__(digests: &PyAny, py: Python) -> PyResult<Self> {
261-
let digests: PyResult<Vec<DirectoryDigest>> = PyIterator::from_object(py, digests)?
260+
fn __new__(digests: &PyAny, _py: Python) -> PyResult<Self> {
261+
let digests: PyResult<Vec<DirectoryDigest>> = PyIterator::from_object(digests)?
262262
.map(|v| {
263263
let py_digest = v?.extract::<PyDigest>()?;
264264
Ok(py_digest.0)

src/rust/engine/src/interning.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl Interns {
5454
let (id, type_id): (u64, TypeId) = {
5555
let v = v.as_ref(py);
5656
let keys = self.keys.as_ref(py);
57-
let id: u64 = if let Some(key) = keys.get_item(v) {
57+
let id: u64 = if let Some(key) = keys.get_item(v)? {
5858
key.extract()?
5959
} else {
6060
let id = self.id_generator.fetch_add(1, atomic::Ordering::Relaxed);

0 commit comments

Comments
 (0)