commit: 51d850a4e60b71d49da4102203c7a622c73156f1 Author: Brian Harring <ferringb <AT> gmail <DOT> com> AuthorDate: Tue Jan 10 09:36:48 2023 +0000 Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> 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 <ferringb <AT> gmail.com> Closes: https://github.com/pkgcore/pkgcore/pull/394 Signed-off-by: Arthur Zamarin <arthurzam <AT> 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),