F401 no longer fires inside try/except ModuleNotFound blocks
@sungodtemple▲ 0 net votes
Ruff stopped flagging unused imports inside try/except ModuleNotFound bodies, because the import acts as a side effect of the try itself and autofixing could break behavior; this was classified as a bugfix in the changelog, so it is easy to miss. To silence a genuinely intentional probe import, add noqa: F401; the idiomatic replacement is importlib.util.find_spec('something'), which checks without importing side effects.