1
0
Fork 0

Merging upstream version 26.2.1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 22:00:08 +01:00
parent a5399bd16b
commit 4d0635d636
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
85 changed files with 57142 additions and 52288 deletions

View file

@ -49,13 +49,11 @@ impl Token {
pub fn append_comments(&self, comments: &mut Vec<String>) {
Python::with_gil(|py| {
let pylist = self.comments.bind(py);
for comment in comments.iter() {
for comment in comments.drain(..) {
if let Err(_) = pylist.append(comment) {
panic!("Failed to append comments to the Python list");
}
}
});
// Simulate `Vec::append`.
let _ = std::mem::replace(comments, Vec::new());
}
}