ruff/crates/ruff_linter/resources/test/fixtures/pyflakes/F811_31.py

22 lines
338 B
Python

"""Regression test for: https://github.com/astral-sh/ruff/issues/12309"""
import contextlib
foo = None
with contextlib.suppress(ImportError):
from some_module import foo
bar = None
try:
from some_module import bar
except ImportError:
pass
try:
baz = None
from some_module import baz
except ImportError:
pass