diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2003-10-06 05:15:13 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2003-10-06 05:15:13 (GMT) |
commit | 0a4a50dd85fb1f9f30ec6e6ff62c71124c52ade6 (patch) | |
tree | b6a38f413d2a31c60f09b80fda8d3a82eaf130aa /Lib | |
parent | 504de6bd2c3a0b717e1192eac2435808ab971c5a (diff) | |
download | cpython-0a4a50dd85fb1f9f30ec6e6ff62c71124c52ade6.zip cpython-0a4a50dd85fb1f9f30ec6e6ff62c71124c52ade6.tar.gz cpython-0a4a50dd85fb1f9f30ec6e6ff62c71124c52ade6.tar.bz2 |
SF patch [ 816787 ] urllib2.URLError don't calll IOError.__init__
Not sure if this fix is great, but it's probably a small improvement.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/urllib2.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/urllib2.py b/Lib/urllib2.py index df3729a..7124dfb 100644 --- a/Lib/urllib2.py +++ b/Lib/urllib2.py @@ -145,8 +145,12 @@ def install_opener(opener): class URLError(IOError): # URLError is a sub-type of IOError, but it doesn't share any of - # the implementation. need to override __init__ and __str__ + # 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 + # slot 0 and strerror in slot 1. This may be better than nothing. def __init__(self, reason): + self.args = reason, self.reason = reason def __str__(self): |