mirror of
				https://github.com/Mikaela/Limnoria.git
				synced 2025-10-30 23:27:24 +01:00 
			
		
		
		
	utils/web.py: Only try catching socket.sslerror if built with SSL support
Closes: Sf#2998820 Signed-off-by: James Vega <jamessan@users.sourceforge.net> (cherry picked from commit f03a3f6c8529c15042908d826235e46123cd29e2)
This commit is contained in:
		
							parent
							
								
									246e09cc99
								
							
						
					
					
						commit
						a6857ce9bf
					
				| @ -36,6 +36,12 @@ import sgmllib | ||||
| import urlparse | ||||
| import htmlentitydefs | ||||
| 
 | ||||
| sockerrors = (socket.error,) | ||||
| try: | ||||
|     sockerrors += (socket.sslerror,) | ||||
| except AttributeError: | ||||
|     pass | ||||
| 
 | ||||
| from str import normalizeWhitespace | ||||
| 
 | ||||
| Request = urllib2.Request | ||||
| @ -106,7 +112,7 @@ def getUrlFd(url, headers=None): | ||||
|         return fd | ||||
|     except socket.timeout, e: | ||||
|         raise Error, TIMED_OUT | ||||
|     except (socket.error, socket.sslerror), e: | ||||
|     except sockerrors, e: | ||||
|         raise Error, strError(e) | ||||
|     except httplib.InvalidURL, e: | ||||
|         raise Error, 'Invalid URL: %s' % e | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 James Vega
						James Vega