Skip to content

Commit 8fa06f4

Browse files
authored
Merge pull request #893 from asottile/os-error-is-an-alias
also rewrite os.error -> OSError
2 parents b0e58ec + 10319a8 commit 8fa06f4

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

pyupgrade/_data.py

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class State(NamedTuple):
4040
'__future__',
4141
'functools',
4242
'mmap',
43+
'os',
4344
'select',
4445
'six',
4546
'six.moves',

pyupgrade/_plugins/oserror_aliases.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from pyupgrade._token_helpers import replace_name
1818

1919
ERROR_NAMES = frozenset(('EnvironmentError', 'IOError', 'WindowsError'))
20-
ERROR_MODULES = frozenset(('mmap', 'select', 'socket'))
20+
ERROR_MODULES = frozenset(('mmap', 'select', 'socket', 'os'))
2121

2222

2323
def _fix_oserror_except(

0 commit comments

Comments
 (0)