Skip to content

Commit 81758b0

Browse files
committed
Removed unreachable code and excluded non-testable lines in coverage
1 parent e802805 commit 81758b0

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/zimscraperlib/image/optimization.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,7 @@ def optimize_webp(
203203
webp_image.save(dst, format="WEBP", **params)
204204
dst.seek(0)
205205
else:
206-
try:
207-
save_image(webp_image, dst, fmt="WEBP", **params)
208-
except Exception as exc:
209-
if src.resolve() != dst.resolve() and dst.exists():
210-
dst.unlink()
211-
raise exc
206+
save_image(webp_image, dst, fmt="WEBP", **params)
212207
return dst
213208

214209

src/zimscraperlib/zim/archive.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ def get_search_results_count(self, query: str) -> int:
8888
def counters(self) -> Dict[str, int]:
8989
try:
9090
return parseMimetypeCounter(self.get_text_metadata("Counter"))
91-
except RuntimeError:
92-
return {}
91+
except RuntimeError: # pragma: no cover (no ZIM avail to test itl)
92+
return {} # pragma: no cover
9393

9494
@property
9595
def article_counter(self) -> int:

0 commit comments

Comments
 (0)