Improve the comment in URLError (#139874)

Clarify that it It overrides `__init__` and `__str__`.
This commit is contained in:
SarahPythonista 2025-10-14 12:31:21 -07:00 committed by GitHub
parent f262297d52
commit c50d794c7b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -18,7 +18,7 @@
class URLError(OSError): class URLError(OSError):
# URLError is a sub-type of OSError, but it doesn't share any of # URLError is a sub-type of OSError, but it doesn't share any of
# the implementation. need to override __init__ and __str__. # the implementation. It overrides __init__ and __str__.
# It sets self.args for compatibility with other OSError # It sets self.args for compatibility with other OSError
# subclasses, but args doesn't have the typical format with errno in # subclasses, but args doesn't have the typical format with errno in
# slot 0 and strerror in slot 1. This may be better than nothing. # slot 0 and strerror in slot 1. This may be better than nothing.