From patchwork Thu Jan 30 16:22:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3,of,6] rust-cpython: use PyList.insert() instead of .insert_item() From: Yuya Nishihara X-Patchwork-Id: 44785 Message-Id: <44c3b090dea5b6f5f048.1580401337@mimosa> To: mercurial-devel@mercurial-scm.org Date: Fri, 31 Jan 2020 01:22:17 +0900 # HG changeset patch # User Yuya Nishihara # Date 1580396910 -32400 # Fri Jan 31 00:08:30 2020 +0900 # Node ID 44c3b090dea5b6f5f048796c997c0d7176e8bc0a # Parent 50dcc8baffa106c54a4e40bbb563e6ee0c8d40a9 rust-cpython: use PyList.insert() instead of .insert_item() Silences the deprecated warning. https://github.com/dgrunwald/rust-cpython/commit/e8cbe864841714c5555db8c90e057bd11e360c7f diff --git a/rust/hg-cpython/src/dirstate/status.rs b/rust/hg-cpython/src/dirstate/status.rs --- a/rust/hg-cpython/src/dirstate/status.rs +++ b/rust/hg-cpython/src/dirstate/status.rs @@ -33,7 +33,7 @@ fn collect_pybytes_list let list = PyList::new(py, &[]); for (i, path) in collection.iter().enumerate() { - list.insert_item( + list.insert( py, i, PyBytes::new(py, path.as_ref().as_bytes()).into_object(),