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:
Benjamin Drung 2025-12-03 13:47:54 +01:00
parent 3d2ee5a1b7
commit 768a517370

View File

@ -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]