mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:25:17 +00:00
23 lines
385 B
Python
23 lines
385 B
Python
"""
|
|
Should emit:
|
|
B022 - on lines 8
|
|
"""
|
|
|
|
import contextlib
|
|
from contextlib import suppress
|
|
|
|
with contextlib.suppress():
|
|
raise ValueError
|
|
|
|
with suppress():
|
|
raise ValueError
|
|
|
|
with contextlib.suppress(ValueError):
|
|
raise ValueError
|
|
|
|
exceptions_to_suppress = []
|
|
if True:
|
|
exceptions_to_suppress.append(ValueError)
|
|
|
|
with contextlib.suppress(*exceptions_to_suppress):
|
|
raise
|