From: Martin v. Löwis Date: Wed, 11 Jul 2012 06:48:34 +0000 (+0200) Subject: Don't use TextIOBase implementations in _RPCFile. X-Git-Tag: v3.3.0b2~240^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c27616580dfd7a4693c28c44ecd03cf749ff45fc;p=thirdparty%2FPython%2Fcpython.git Don't use TextIOBase implementations in _RPCFile. --- diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py index 4296aaf3236d..43a7f659b60b 100644 --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -247,12 +247,18 @@ class MyRPCServer(rpc.RPCServer): 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):