mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	Don't use TextIOBase implementations in _RPCFile.
This commit is contained in:
		
							parent
							
								
									8a75bed317
								
							
						
					
					
						commit
						c27616580d
					
				
					 1 changed files with 8 additions and 2 deletions
				
			
		|  | @ -247,12 +247,18 @@ def handle_error(self, request, client_address): | |||
| 
 | ||||
| class _RPCFile(io.TextIOBase): | ||||
|     """Wrapper class for the RPC proxy to typecheck arguments | ||||
|     that may not support pickling.""" | ||||
|     that may not support pickling. The base class is there only | ||||
|     to support type tests; all implementations come from the remote | ||||
|     object.""" | ||||
| 
 | ||||
|     def __init__(self, rpc): | ||||
|         super.__setattr__(self, 'rpc', rpc) | ||||
| 
 | ||||
|     def __getattr__(self, name): | ||||
|     def __getattribute__(self, name): | ||||
|         # When accessing the 'rpc' attribute, use ours | ||||
|         if name == 'rpc': | ||||
|             return io.TextIOBase.__getattribute__(self, name) | ||||
|         # Else only look into the remote object only | ||||
|         return getattr(self.rpc, name) | ||||
| 
 | ||||
|     def __setattr__(self, name, value): | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Martin v. Löwis
						Martin v. Löwis