mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Fix py3k warnings in httplib
This commit is contained in:
		
							parent
							
								
									b844ef7950
								
							
						
					
					
						commit
						92331d5e1b
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		|  | @ -706,8 +706,8 @@ def _tunnel(self): | |||
| 
 | ||||
|         if code != 200: | ||||
|             self.close() | ||||
|             raise socket.error, "Tunnel connection failed: %d %s" % (code, | ||||
|                                                                      message.strip()) | ||||
|             raise socket.error("Tunnel connection failed: %d %s" % (code, | ||||
|                                                                     message.strip())) | ||||
|         while True: | ||||
|             line = response.fp.readline() | ||||
|             if line == '\r\n': break | ||||
|  | @ -757,7 +757,7 @@ def send(self, str): | |||
|             else: | ||||
|                 self.sock.sendall(str) | ||||
|         except socket.error, v: | ||||
|             if v[0] == 32:      # Broken pipe | ||||
|             if v.args[0] == 32:      # Broken pipe | ||||
|                 self.close() | ||||
|             raise | ||||
| 
 | ||||
|  | @ -929,7 +929,7 @@ def request(self, method, url, body=None, headers={}): | |||
|             self._send_request(method, url, body, headers) | ||||
|         except socket.error, v: | ||||
|             # trap 'Broken pipe' if we're allowed to automatically reconnect | ||||
|             if v[0] != 32 or not self.auto_open: | ||||
|             if v.args[0] != 32 or not self.auto_open: | ||||
|                 raise | ||||
|             # try one more time | ||||
|             self._send_request(method, url, body, headers) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Antoine Pitrou
						Antoine Pitrou