Commit c2761658 authored by Martin v. Löwis's avatar Martin v. Löwis

Don't use TextIOBase implementations in _RPCFile.

parent 8a75bed3
...@@ -247,12 +247,18 @@ class MyRPCServer(rpc.RPCServer): ...@@ -247,12 +247,18 @@ class MyRPCServer(rpc.RPCServer):
class _RPCFile(io.TextIOBase): class _RPCFile(io.TextIOBase):
"""Wrapper class for the RPC proxy to typecheck arguments """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): def __init__(self, rpc):
super.__setattr__(self, 'rpc', 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) return getattr(self.rpc, name)
def __setattr__(self, name, value): def __setattr__(self, name, value):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment