changeset 42793:98901eb12245

rust-parsers: fix unboxing of PyInt on Python 3 Broken at 7cae6bc29ff9.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 17 Aug 2019 12:17:46 +0900
parents e91411fcc697
children cc424cc16704
files rust/hg-cpython/src/parsers.rs
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-cpython/src/parsers.rs	Tue Aug 20 17:12:36 2019 +0200
+++ b/rust/hg-cpython/src/parsers.rs	Sat Aug 17 12:17:46 2019 +0900
@@ -12,7 +12,7 @@
 //!
 use cpython::{
     exc, PyBytes, PyDict, PyErr, PyInt, PyModule, PyResult, PyTuple, Python,
-    ToPyObject,
+    PythonObject, ToPyObject,
 };
 use hg::{
     pack_dirstate, parse_dirstate, utils::copy_into_array, DirstateEntry,
@@ -123,7 +123,7 @@
             p1: copy_into_array(&p1),
             p2: copy_into_array(&p2),
         },
-        Duration::from_secs(now.value(py) as u64),
+        Duration::from_secs(now.as_object().extract::<u64>(py)?),
     ) {
         Ok(packed) => {
             for (