Skip to content

Commit 6b3e297

Browse files
committed
fix: satisfy ruff SIM105 in s3 warning helper
1 parent 85c0437 commit 6b3e297

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/cachier/cores/s3.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""An S3-based caching core for cachier."""
22

33
import asyncio
4+
import contextlib
45
import pickle
56
import time
67
import warnings
@@ -28,10 +29,8 @@ class MissingS3Bucket(ValueError):
2829

2930
def _safe_warn(message: str, category: type[Warning] = UserWarning) -> None:
3031
"""Emit a warning without raising when warnings are configured as errors."""
31-
try:
32+
with contextlib.suppress(Warning):
3233
warnings.warn(message, category, stacklevel=2)
33-
except Warning:
34-
pass
3534

3635

3736
class _S3Core(_BaseCore):

0 commit comments

Comments
 (0)