Patchwork [3,of,6] rust-cpython: use PyList.insert() instead of .insert_item()

login
register
mail settings
Submitter Yuya Nishihara
Date Jan. 30, 2020, 4:22 p.m.
Message ID <44c3b090dea5b6f5f048.1580401337@mimosa>
Download mbox | patch
Permalink /patch/44785/
State Accepted
Headers show

Comments

Yuya Nishihara - Jan. 30, 2020, 4:22 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# 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

Patch

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<P: AsRef<HgPath>
     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(),