diff --git a/pyupgrade/_data.py b/pyupgrade/_data.py index f9516df5..15e03a72 100644 --- a/pyupgrade/_data.py +++ b/pyupgrade/_data.py @@ -40,6 +40,7 @@ class State(NamedTuple): '__future__', 'functools', 'mmap', + 'os', 'select', 'six', 'six.moves', diff --git a/pyupgrade/_plugins/oserror_aliases.py b/pyupgrade/_plugins/oserror_aliases.py index 57d272b1..c11cadfd 100644 --- a/pyupgrade/_plugins/oserror_aliases.py +++ b/pyupgrade/_plugins/oserror_aliases.py @@ -17,7 +17,7 @@ from pyupgrade._token_helpers import replace_name ERROR_NAMES = frozenset(('EnvironmentError', 'IOError', 'WindowsError')) -ERROR_MODULES = frozenset(('mmap', 'select', 'socket')) +ERROR_MODULES = frozenset(('mmap', 'select', 'socket', 'os')) def _fix_oserror_except(