We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 85c0437 commit 6b3e297Copy full SHA for 6b3e297
1 file changed
src/cachier/cores/s3.py
@@ -1,6 +1,7 @@
1
"""An S3-based caching core for cachier."""
2
3
import asyncio
4
+import contextlib
5
import pickle
6
import time
7
import warnings
@@ -28,10 +29,8 @@ class MissingS3Bucket(ValueError):
28
29
30
def _safe_warn(message: str, category: type[Warning] = UserWarning) -> None:
31
"""Emit a warning without raising when warnings are configured as errors."""
- try:
32
+ with contextlib.suppress(Warning):
33
warnings.warn(message, category, stacklevel=2)
- except Warning:
34
- pass
35
36
37
class _S3Core(_BaseCore):
0 commit comments