-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
os.error is an alias for OSError, but is not standardized as part of https://docs.astral.sh/ruff/rules/os-error-alias/
>>> import os; OSError is os.error
Trueimport os
try:
pass
except (WindowsError, os.error):
passbecomes:
import os
try:
pass
except (OSError, os.error):
passexpected:
import os # This import is now unused and can be removed
try:
pass
except OSError:
passThis would be a deviation from pyupgrade, I have opened the same request in parallel: asottile/pyupgrade#892
Edit: This was just added in asottile/pyupgrade#893
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working