Skip to content

Commit c276165

Browse files
committed
Don't use TextIOBase implementations in _RPCFile.
1 parent 8a75bed commit c276165

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

Lib/idlelib/run.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,18 @@ def handle_error(self, request, client_address):
247247

248248
class _RPCFile(io.TextIOBase):
249249
"""Wrapper class for the RPC proxy to typecheck arguments
250-
that may not support pickling."""
250+
that may not support pickling. The base class is there only
251+
to support type tests; all implementations come from the remote
252+
object."""
251253

252254
def __init__(self, rpc):
253255
super.__setattr__(self, 'rpc', rpc)
254256

255-
def __getattr__(self, name):
257+
def __getattribute__(self, name):
258+
# When accessing the 'rpc' attribute, use ours
259+
if name == 'rpc':
260+
return io.TextIOBase.__getattribute__(self, name)
261+
# Else only look into the remote object only
256262
return getattr(self.rpc, name)
257263

258264
def __setattr__(self, name, value):

0 commit comments

Comments
 (0)