mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-12-08 16:43:51 +00:00
ubuntutools/archive.py: use 'yield from'
pylint complains: ``` ubuntutools/archive.py:343:8: R1737: Use 'yield from' directly instead of yielding each element one by one (use-yield-from) ubuntutools/archive.py:346:8: R1737: Use 'yield from' directly instead of yielding each element one by one (use-yield-from) ubuntutools/archive.py:638:8: R1737: Use 'yield from' directly instead of yielding each element one by one (use-yield-from) ```
This commit is contained in:
parent
3d2ee5a1b7
commit
768a517370
@ -340,11 +340,9 @@ class SourcePackage(ABC):
|
|||||||
def _archive_servers(self):
|
def _archive_servers(self):
|
||||||
"Generator for mirror and master servers"
|
"Generator for mirror and master servers"
|
||||||
# Always provide the mirrors first
|
# Always provide the mirrors first
|
||||||
for server in self.mirrors:
|
yield from self.mirrors
|
||||||
yield server
|
|
||||||
# Don't repeat servers that are in both mirrors and masters
|
# Don't repeat servers that are in both mirrors and masters
|
||||||
for server in set(self.masters) - set(self.mirrors):
|
yield from set(self.masters) - set(self.mirrors)
|
||||||
yield server
|
|
||||||
|
|
||||||
def _source_urls(self, name):
|
def _source_urls(self, name):
|
||||||
"Generator of sources for name"
|
"Generator of sources for name"
|
||||||
@ -635,8 +633,7 @@ class DebianSourcePackage(SourcePackage):
|
|||||||
|
|
||||||
def _source_urls(self, name):
|
def _source_urls(self, name):
|
||||||
"Generator of sources for name"
|
"Generator of sources for name"
|
||||||
for url in super()._source_urls(name):
|
yield from super()._source_urls(name)
|
||||||
yield url
|
|
||||||
if name in self.snapshot_files:
|
if name in self.snapshot_files:
|
||||||
yield self.snapshot_files[name]
|
yield self.snapshot_files[name]
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user