示例#1
0
 def __reduce__(self):
     from .context import assert_spawning
     try:
         assert_spawning(self)
     except RuntimeError:
         raise TypeError('Pickling an AuthenticationKey object is '
                         'disallowed for security reasons')
     return AuthenticationKey, (bytes(self), )
示例#2
0
 def __getstate__(self):
     context.assert_spawning(self)
     return self._reader, self._writer, self._rlock, self._wlock, self._copy_tensor
示例#3
0
 def __getstate__(self):
     assert_spawning(self)
     return (self._lock, self._sleeping_count,
             self._woken_count, self._wait_semaphore)
示例#4
0
 def __getstate__(self):
     assert_spawning(self)
     sl = self._semlock
     h = sl.handle
     return (h, sl.kind, sl.maxvalue, sl.name)
示例#5
0
 def __getstate__(self):
     assert_spawning(self)
     return self._reader, self._writer, self._rlock, self._wlock
示例#6
0
 def __getstate__(self):
     assert_spawning(self)
     return (self._ignore_epipe, self._maxsize, self._reader, self._writer,
             self._reducers, self._rlock, self._wlock, self._sem,
             self._opid)