-
Notifications
You must be signed in to change notification settings - Fork 87
Unexpected TRY400 indicated in unchanged code #292
Copy link
Copy link
Closed
Description
In the feature/compilers-module-redux branch, I'm attempting to refactor the code. When I do, a TRY400 error is indicated even though the code hasn't changed:
__________________________________________________________________ test session ___________________________________________________________________
distutils/compilers/C/msvc.py:163:9: TRY400 Use `logging.exception` instead of `logging.error`
|
161 | ).decode('utf-16le', errors='replace')
162 | except subprocess.CalledProcessError as exc:
163 | log.error(exc.output)
| ^^^^^^^^^^^^^^^^^^^^^ TRY400
164 | raise DistutilsPlatformError(f"Error executing {exc.cmd}")
|
= help: Replace with `exception`
First off, that's a nuisance error. What if what I really wanted was to log just the error message? Ruff shouldn't be griping about legitimate usage of supported interfaces. If logging.error shouldn't ever be used, they should file that as a feature change to CPython to get that functionality deprecated.
Second, why is this error only emitted in the branch (bac29f1), when the same code succeeds just fine in main?
@DimitriPapadopoulos What do you make of this error?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels