From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C9C6515800F for ; Fri, 20 Jan 2023 08:01:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 09183E0876; Fri, 20 Jan 2023 08:01:28 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DF54AE0876 for ; Fri, 20 Jan 2023 08:01:27 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C7E3D340AEC for ; Fri, 20 Jan 2023 08:01:26 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 308B962F for ; Fri, 20 Jan 2023 08:01:25 +0000 (UTC) From: "Arthur Zamarin" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Arthur Zamarin" Message-ID: <1674201675.51d850a4e60b71d49da4102203c7a622c73156f1.arthurzam@gentoo> Subject: [gentoo-commits] proj/pkgcore/pkgcore:master commit in: src/pkgcore/sync/ X-VCS-Repository: proj/pkgcore/pkgcore X-VCS-Files: src/pkgcore/sync/rsync.py X-VCS-Directories: src/pkgcore/sync/ X-VCS-Committer: arthurzam X-VCS-Committer-Name: Arthur Zamarin X-VCS-Revision: 51d850a4e60b71d49da4102203c7a622c73156f1 X-VCS-Branch: master Date: Fri, 20 Jan 2023 08:01:25 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b540fe4c-0de3-4494-8b89-b6260d20103a X-Archives-Hash: 481104f1da3f4d5a8ee7ab7ed347f26f commit: 51d850a4e60b71d49da4102203c7a622c73156f1 Author: Brian Harring gmail com> AuthorDate: Tue Jan 10 09:36:48 2023 +0000 Commit: Arthur Zamarin gentoo org> CommitDate: Fri Jan 20 08:01:15 2023 +0000 URL: https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=51d850a4 refactor(sync): Remove unused variable assignment. We're only trying to limit the retries, thus use islice instead. Signed-off-by: Brian Harring gmail.com> Closes: https://github.com/pkgcore/pkgcore/pull/394 Signed-off-by: Arthur Zamarin gentoo.org> src/pkgcore/sync/rsync.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pkgcore/sync/rsync.py b/src/pkgcore/sync/rsync.py index b0f032731..acf1793bf 100644 --- a/src/pkgcore/sync/rsync.py +++ b/src/pkgcore/sync/rsync.py @@ -7,6 +7,7 @@ import os import socket import tempfile import time +from itertools import islice from snakeoil.osutils import pjoin @@ -142,7 +143,7 @@ class rsync_syncer(base.ExternalSyncer): # zip limits to the shortest iterable ret = None - for count, ip in zip(range(self.retries), self._get_ips()): + for ip in islice(self._get_ips(), self.retries): cmd = [ self.binary_path, self.uri.replace(self.hostname, ip, 1),