How to use the execnet.gateway_base.Unserializer function in execnet

To help you get started, we’ve selected a few execnet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pytest-dev / execnet / execnet / gateway_base.py View on Github external
def _buildopcodes():
    l = []
    later_added = {"COMPLEX": 1}
    for name, func in Unserializer.__dict__.items():
        if name.startswith("load_"):
            opname = name[5:].upper()
            l.append((opname, func))
    l.sort(key=lambda x: (later_added.get(x[0], 0), x[0]))

    for i, (opname, func) in enumerate(l):
        assert i < 26, "xxx"
        i = bchr(64 + i)
        Unserializer.num2func[i] = func
        setattr(opcode, opname, i)
github pytest-dev / execnet / execnet / gateway_base.py View on Github external
def __init__(self, io, id, _startcount=2):
        self.execmodel = io.execmodel
        self._io = io
        self.id = id
        self._strconfig = (Unserializer.py2str_as_py3str, Unserializer.py3str_as_py2str)
        self._channelfactory = ChannelFactory(self, _startcount)
        self._receivelock = self.execmodel.RLock()
        # globals may be NONE at process-termination
        self.__trace = trace
        self._geterrortext = geterrortext
        self._receivepool = self.execmodel.WorkerPool()
github devpi / devpi / server / devpi_server / fileutil.py View on Github external
def loads(data):
    return Unserializer(
        BytesIO(data),
        strconfig=(False, False)).load(versioned=False)