From cc098ecd5f5d87fa4ffb2bfb7335a102fe961cf4 Mon Sep 17 00:00:00 2001 From: Mrityunjay Raj Date: Sun, 5 Jul 2026 06:41:24 +0530 Subject: [PATCH] repository: use try/except/else in get_many, fix misleading comment --- src/borg/repository.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/borg/repository.py b/src/borg/repository.py index d73ce7a97..422a51400 100644 --- a/src/borg/repository.py +++ b/src/borg/repository.py @@ -829,7 +829,7 @@ class Repository: self._lock_refresh() entry = self.chunks.get(id_) if entry is None or self.chunks.is_pending(id_): - # id is unknown or still buffered, not yet in a pack: read it with get() + # id unknown or still buffered: get() raises or returns None accordingly yield self.get(id_, read_data=True, raise_missing=raise_missing) continue try: @@ -838,8 +838,8 @@ class Repository: if raise_missing: raise self.ObjectNotFound(id_, str(self._location)) from None yield None - continue - yield reader.read(entry.obj_offset, entry.obj_size) + else: + yield reader.read(entry.obj_offset, entry.obj_size) def put(self, id, data): """put a repo object