コード例 #1
0
ファイル: reduction.py プロジェクト: Likidha/Unicon
def reduce_handle(handle):
    if Popen.thread_is_spawning():
        return (None, Popen.duplicate_for_child(handle), True)
    dup_handle = duplicate(handle)
    _cache.add(dup_handle)
    sub_debug('reducing handle %d', handle)
    return (_get_listener().address, dup_handle, False)
コード例 #2
0
ファイル: reduction.py プロジェクト: Arrjaan/Cliff
def reduce_handle(handle):
    if Popen.thread_is_spawning():
        return (None, Popen.duplicate_for_child(handle), True)
    dup_handle = duplicate(handle)
    _cache.add(dup_handle)
    sub_debug('reducing handle %d', handle)
    return (_get_listener().address, dup_handle, False)
コード例 #3
0
ファイル: process.py プロジェクト: Fclem/isbio
	def __reduce__(self):
		from multiprocessing.forking import Popen
		if not Popen.thread_is_spawning():
			raise TypeError(
				'Pickling an AuthenticationString object is '
				'disallowed for security reasons'
			)
		return AuthenticationString, (bytes(self),)
コード例 #4
0
 def __reduce__(self):
     kwds = {}
     if Popen.thread_is_spawning():
         kwds['authkey'] = self._authkey
     if getattr(self, '_isauto', False):
         kwds['exposed'] = self._exposed_
         return (RebuildProxy, (AutoProxy, self._token, self._serializer,
                                kwds))
     return (RebuildProxy, (type(self), self._token, self._serializer,
                            kwds))
コード例 #5
0
    def __reduce__(self):
        kwds = {}
        if Popen.thread_is_spawning():
            kwds['authkey'] = self._authkey

        if getattr(self, '_isauto', False):
            kwds['exposed'] = self._exposed_
            return (RebuildProxy,
                    (AutoProxy, self._token, self._serializer, kwds))
        else:
            return (RebuildProxy,
                    (type(self), self._token, self._serializer, kwds))
コード例 #6
0
 def __reduce__(self):
     from multiprocessing.forking import Popen
     if not Popen.thread_is_spawning():
         raise TypeError('Pickling an AuthenticationString object is '
                         'disallowed for security reasons')
     return AuthenticationString, (bytes(self), )