MCPcopy Index your code
hub / github.com/python/cpython / ConnectionWrapper

Class ConnectionWrapper

Lib/multiprocessing/connection.py:1008–1021  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1006#
1007
1008class ConnectionWrapper(object):
1009 def __init__(self, conn, dumps, loads):
1010 self._conn = conn
1011 self._dumps = dumps
1012 self._loads = loads
1013 for attr in ('fileno', 'close', 'poll', 'recv_bytes', 'send_bytes'):
1014 obj = getattr(conn, attr)
1015 setattr(self, attr, obj)
1016 def send(self, obj):
1017 s = self._dumps(obj)
1018 self._conn.send_bytes(s)
1019 def recv(self):
1020 s = self._conn.recv_bytes()
1021 return self._loads(s)
1022
1023def _xml_dumps(obj):
1024 return xmlrpclib.dumps((obj,), None, None, None, 1).encode('utf-8')

Callers 2

acceptMethod · 0.85
XmlClientFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…