mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Replace IOError with OSError (#16715)
This commit is contained in:
parent
16bdd4120d
commit
f7a17b48d7
121 changed files with 381 additions and 386 deletions
|
@ -1,6 +1,6 @@
|
|||
"""Exception classes raised by urllib.
|
||||
|
||||
The base exception class is URLError, which inherits from IOError. It
|
||||
The base exception class is URLError, which inherits from OSError. It
|
||||
doesn't define any behavior of its own, but is the base class for all
|
||||
exceptions defined in this package.
|
||||
|
||||
|
@ -17,11 +17,11 @@ __all__ = ['URLError', 'HTTPError', 'ContentTooShortError']
|
|||
|
||||
|
||||
# do these error classes make sense?
|
||||
# make sure all of the IOError stuff is overridden. we just want to be
|
||||
# make sure all of the OSError stuff is overridden. we just want to be
|
||||
# subtypes.
|
||||
|
||||
class URLError(IOError):
|
||||
# URLError is a sub-type of IOError, but it doesn't share any of
|
||||
class URLError(OSError):
|
||||
# URLError is a sub-type of OSError, but it doesn't share any of
|
||||
# the implementation. need to override __init__ and __str__.
|
||||
# It sets self.args for compatibility with other EnvironmentError
|
||||
# subclasses, but args doesn't have the typical format with errno in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue