ua-parser / uap-python

Python implementation of ua-parser
Apache License 2.0
561 stars 152 forks source link

Ruff does not understand `contextlib.suppress` #216

Closed masklinn closed 3 months ago

masklinn commented 3 months ago

Not entirely clear when F811 started triggering on this pattern (it didn't 3 months ago but is now unhappy with this).

Use find_spec to perform a conditional import rather than recover from a failing import. This is generally less efficient, but given it's only done at import it likely doesnt matter.