Commits

sbt  committed e8b755c Draft

Try to fix test for ability to send fds between processes

  • Participants
  • Parent commits 58bf6be
  • Branches spawn

Comments (0)

Files changed (2)

File Lib/multiprocessing/popen_forkserver.py

 __all__ = ['PopenForkServer', 'forkserver_helper']
 
 
-if not (hasattr(socket, 'CMSG_LEN') and hasattr(socket, 'SCM_RIGHTS')):
+if not (hasattr(socket, 'CMSG_LEN') and
+        hasattr(socket, 'SCM_RIGHTS') and
+        hasattr(socket.socket, 'sendmsg')):
     raise ImportError('No support for sending fds between processes')
 
 #

File Lib/multiprocessing/reduction.py

 #
 #
 
-HAVE_SEND_HANDLE = not(sys.platform == 'win32' or
-                       (hasattr(socket, 'CMSG_LEN') and
-                        hasattr(socket, 'SCM_RIGHTS')))
+HAVE_SEND_HANDLE = (sys.platform == 'win32' or
+                    (hasattr(socket, 'CMSG_LEN') and
+                     hasattr(socket, 'SCM_RIGHTS') and
+                     hasattr(socket.socket, 'sendmsg')))
 
 #
 # Platform specific definitions