wemake-python-styleguide
wemake-python-styleguide copied to clipboard
WPS440 is wrong in compat shim modules
Bug report
What's wrong
When having compat shims, this happens:
# _compat.py:
try:
from subprocess import CompletedProcess # noqa: S404, WPS433
except ImportError:
class CompletedProcess:
...
src/ZZZ/_compat.py:30:5: WPS440 Found block variables overlap: CompletedProcess
This is wrong because the except block will create an object only if try failed so there's 100% no overlapping.
How is that should be
No error
System information
flake8 information
v3.8.0a2
pip information
(doesn't really matter and it's under pre-commit so hard to reach)
Yes, I confirm: this is really annoying.