diff -r b2d238adf802 Doc/library/multiprocessing.rst --- a/Doc/library/multiprocessing.rst Wed Feb 18 08:56:47 2015 -0500 +++ b/Doc/library/multiprocessing.rst Wed Feb 18 14:14:16 2015 -0600 @@ -262,14 +262,6 @@ Without using the lock output from the different processes is liable to get all mixed up. -.. note:: - - Some of this package's functionality requires a functioning shared semaphore - implementation on the host operating system. Without one, the - :mod:`multiprocessing.synchronize` module will be disabled, and attempts to - import it will result in an :exc:`ImportError`. See - :issue:`3770` for additional information. - Sharing state between processes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -808,6 +800,14 @@ immediately without waiting to flush enqueued data to the underlying pipe, and you don't care about lost data. + .. note:: + + This class's functionality requires a functioning shared semaphore + implementation on the host operating system. Without one, the + functionality in this class will be disabled, and attempts to + instantiate a :class:`Queue` will result in an :exc:`ImportError`. See + :issue:`3770` for additional information. The same holds true for any + of the specialized queue types listed below. .. class:: SimpleQueue() @@ -1183,6 +1183,14 @@ This differs from the behaviour of :mod:`threading` where SIGINT will be ignored while the equivalent blocking calls are in progress. +.. note:: + + Some of this package's functionality requires a functioning shared semaphore + implementation on the host operating system. Without one, the + :mod:`multiprocessing.synchronize` module will be disabled, and attempts to + import it will result in an :exc:`ImportError`. See + :issue:`3770` for additional information. + Shared :mod:`ctypes` Objects ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff -r b2d238adf802 Lib/multiprocessing/queues.py --- a/Lib/multiprocessing/queues.py Wed Feb 18 08:56:47 2015 -0500 +++ b/Lib/multiprocessing/queues.py Wed Feb 18 14:14:16 2015 -0600 @@ -35,7 +35,14 @@ def __init__(self, maxsize=0, *, ctx): if maxsize <= 0: - maxsize = _multiprocessing.SemLock.SEM_VALUE_MAX + try: + maxsize = _multiprocessing.SemLock.SEM_VALUE_MAX + except (AttributeError): + raise ImportError("This platform lacks a functioning sem_open" + + " implementation, therefore, the required" + + " semaphore primitives needed will not" + + " function, see issue 3770.") + self._maxsize = maxsize self._reader, self._writer = connection.Pipe(duplex=False) self._rlock = ctx.Lock()