diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-06-13 19:13:39 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-06-13 19:13:39 (GMT) |
commit | dfd79494ce78868c937dc91eddd630cbdcae5611 (patch) | |
tree | 497db9bd37079421b144f33635c6bdd4b7058db5 /Lib/multiprocessing/reduction.py | |
parent | c9798fc7094c8ddcd73cc73870bbe0a1d4b5b1b1 (diff) | |
download | cpython-dfd79494ce78868c937dc91eddd630cbdcae5611.zip cpython-dfd79494ce78868c937dc91eddd630cbdcae5611.tar.gz cpython-dfd79494ce78868c937dc91eddd630cbdcae5611.tar.bz2 |
convert multiprocessing to unix line endings
Diffstat (limited to 'Lib/multiprocessing/reduction.py')
-rw-r--r-- | Lib/multiprocessing/reduction.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/multiprocessing/reduction.py b/Lib/multiprocessing/reduction.py index 0d6cf4f..17778ef 100644 --- a/Lib/multiprocessing/reduction.py +++ b/Lib/multiprocessing/reduction.py @@ -36,7 +36,7 @@ if not(sys.platform == 'win32' or hasattr(_multiprocessing, 'recvfd')): if sys.platform == 'win32':
import _subprocess
from ._multiprocessing import win32
-
+
def send_handle(conn, handle, destination_pid):
process_handle = win32.OpenProcess(
win32.PROCESS_ALL_ACCESS, False, destination_pid
@@ -46,14 +46,14 @@ if sys.platform == 'win32': conn.send(new_handle)
finally:
close(process_handle)
-
+
def recv_handle(conn):
return conn.recv()
else:
def send_handle(conn, handle, destination_pid):
_multiprocessing.sendfd(conn.fileno(), handle)
-
+
def recv_handle(conn):
return _multiprocessing.recvfd(conn.fileno())
@@ -93,7 +93,7 @@ def _get_listener(): def _serve():
from .util import is_exiting, sub_warning
-
+
while 1:
try:
conn = _listener.accept()
@@ -109,7 +109,7 @@ def _serve(): 'thread for sharing handles raised exception :\n' +
'-'*79 + '\n' + traceback.format_exc() + '-'*79
)
-
+
#
# Functions to be used for pickling/unpickling objects with handles
#
@@ -176,15 +176,15 @@ copy_reg.pickle(socket.socket, reduce_socket) #
if sys.platform == 'win32':
-
+
def reduce_pipe_connection(conn):
rh = reduce_handle(conn.fileno())
return rebuild_pipe_connection, (rh, conn.readable, conn.writable)
-
+
def rebuild_pipe_connection(reduced_handle, readable, writable):
handle = rebuild_handle(reduced_handle)
return _multiprocessing.PipeConnection(
handle, readable=readable, writable=writable
)
-
+
copy_reg.pickle(_multiprocessing.PipeConnection, reduce_pipe_connection)
|