mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-12-08 08:33:29 +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):
|
||||
"Generator for mirror and master servers"
|
||||
# Always provide the mirrors first
|
||||
for server in self.mirrors:
|
||||
yield server
|
||||
yield from self.mirrors
|
||||
# Don't repeat servers that are in both mirrors and masters
|
||||
for server in set(self.masters) - set(self.mirrors):
|
||||
yield server
|
||||
yield from set(self.masters) - set(self.mirrors)
|
||||
|
||||
def _source_urls(self, name):
|
||||
"Generator of sources for name"
|
||||
@ -635,8 +633,7 @@ class DebianSourcePackage(SourcePackage):
|
||||
|
||||
def _source_urls(self, name):
|
||||
"Generator of sources for name"
|
||||
for url in super()._source_urls(name):
|
||||
yield url
|
||||
yield from super()._source_urls(name)
|
||||
if name in self.snapshot_files:
|
||||
yield self.snapshot_files[name]
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user