Patchwork D6396: rust-python3: compatibility fix for integer conversion

login
register
mail settings
Submitter phabricator
Date May 18, 2019, 3:31 a.m.
Message ID <b5a3af544bbf7417fba0d579bddabc21@localhost.localdomain>
Download mbox | patch
Permalink /patch/40134/
State Not Applicable
Headers show

Comments

phabricator - May 18, 2019, 3:31 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGf887a8c1abde: rust-python3: compatibility fix for integer conversion (authored by gracinet, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6396?vs=15163&id=15186

REVISION DETAIL
  https://phab.mercurial-scm.org/D6396

AFFECTED FILES
  rust/hg-cpython/src/discovery.rs

CHANGE DETAILS




To: gracinet, #hg-reviewers
Cc: durin42, kevincox, mercurial-devel

Patch

diff --git a/rust/hg-cpython/src/discovery.rs b/rust/hg-cpython/src/discovery.rs
--- a/rust/hg-cpython/src/discovery.rs
+++ b/rust/hg-cpython/src/discovery.rs
@@ -15,7 +15,8 @@ 
 use crate::conversion::{py_set, rev_pyiter_collect};
 use cindex::Index;
 use cpython::{
-    ObjectProtocol, PyDict, PyModule, PyObject, PyResult, Python, ToPyObject,
+    ObjectProtocol, PyDict, PyModule, PyObject, PyResult, Python,
+    PythonObject, ToPyObject,
 };
 use exceptions::GraphError;
 use hg::discovery::PartialDiscovery as CorePartialDiscovery;
@@ -89,8 +90,9 @@ 
         let stats = self.inner(py).borrow().stats();
         let as_dict: PyDict = PyDict::new(py);
         as_dict.set_item(py, "undecided",
-                         stats.undecided.map(|l| l.to_py_object(py))
-                              .unwrap_or_else(|| py.None()))?;
+                         stats.undecided.map(
+                             |l| l.to_py_object(py).into_object())
+                             .unwrap_or_else(|| py.None()))?;
         Ok(as_dict)
     }