mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	SF patch [ 816787 ] urllib2.URLError don't calll IOError.__init__
Not sure if this fix is great, but it's probably a small improvement.
This commit is contained in:
		
							parent
							
								
									504de6bd2c
								
							
						
					
					
						commit
						0a4a50dd85
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		|  | @ -145,8 +145,12 @@ def install_opener(opener): | ||||||
| 
 | 
 | ||||||
| class URLError(IOError): | class URLError(IOError): | ||||||
|     # URLError is a sub-type of IOError, but it doesn't share any of |     # 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): |     def __init__(self, reason): | ||||||
|  |         self.args = reason, | ||||||
|         self.reason = reason |         self.reason = reason | ||||||
| 
 | 
 | ||||||
|     def __str__(self): |     def __str__(self): | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Jeremy Hylton
						Jeremy Hylton