Skip to content

Merge {IO,Environment,Windows}Error into OSError for Python 3.3+ #1852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions stdlib/3/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -937,11 +937,18 @@ class SystemExit(BaseException):
code = 0
class Exception(BaseException): ...
class ArithmeticError(Exception): ...
class EnvironmentError(Exception):
class OSError(Exception):
errno = 0
strerror = ... # type: str
# TODO can this be bytes?
filename = ... # type: str
# filename, filename2 are actually Union[str, bytes, None]
filename = ... # type: Any
if sys.version_info >= (3, 4):
filename2 = ... # type: Any
if sys.platform == 'win32':
winerror = 0
IOError = OSError
EnvironmentError = OSError
WindowsError = OSError
class LookupError(Exception): ...
class RuntimeError(Exception): ...
class ValueError(Exception): ...
Expand All @@ -950,7 +957,6 @@ class AttributeError(Exception): ...
class BufferError(Exception): ...
class EOFError(Exception): ...
class FloatingPointError(ArithmeticError): ...
class IOError(EnvironmentError): ...
class ImportError(Exception):
if sys.version_info >= (3, 3):
name = ... # type: str
Expand All @@ -962,7 +968,6 @@ class KeyError(LookupError): ...
class MemoryError(Exception): ...
class NameError(Exception): ...
class NotImplementedError(RuntimeError): ...
class OSError(EnvironmentError): ...
class BlockingIOError(OSError):
characters_written = 0
class ChildProcessError(OSError): ...
Expand All @@ -979,8 +984,6 @@ class NotADirectoryError(OSError): ...
class PermissionError(OSError): ...
class ProcessLookupError(OSError): ...
class TimeoutError(OSError): ...
class WindowsError(OSError):
winerror = ... # type: int
class OverflowError(ArithmeticError): ...
class ReferenceError(Exception): ...
class StopIteration(Exception):
Expand Down