| 17 | |
| 18 | |
| 19 | class URLError(OSError): |
| 20 | # URLError is a sub-type of OSError, but it doesn't share any of |
| 21 | # the implementation. It overrides __init__ and __str__. |
| 22 | # It sets self.args for compatibility with other OSError |
| 23 | # subclasses, but args doesn't have the typical format with errno in |
| 24 | # slot 0 and strerror in slot 1. This may be better than nothing. |
| 25 | def __init__(self, reason, filename=None): |
| 26 | self.args = reason, |
| 27 | self.reason = reason |
| 28 | if filename is not None: |
| 29 | self.filename = filename |
| 30 | |
| 31 | def __str__(self): |
| 32 | return '<urlopen error %s>' % self.reason |
| 33 | |
| 34 | |
| 35 | class HTTPError(URLError, urllib.response.addinfourl): |
no outgoing calls
no test coverage detected
searching dependent graphs…