cpython: a49737bd6086 (original) (raw)
Mercurial > cpython
changeset 95487:a49737bd6086
Issue #23400: Raise same exception on both Python 2 and 3 if sem_open is not available. Patch by Davin Potts. [#23400]
Berker Peksag berker.peksag@gmail.com | |
---|---|
date | Wed, 08 Apr 2015 17:57:44 +0300 |
parents | e64197dad303(current diff)749fd043de95(diff) |
children | c7dbb5e7423d |
files | Doc/library/multiprocessing.rst Lib/multiprocessing/queues.py Misc/NEWS |
diffstat | 3 files changed, 21 insertions(+), 9 deletions(-)[+] [-] Doc/library/multiprocessing.rst 24 Lib/multiprocessing/queues.py 3 Misc/NEWS 3 |
line wrap: on
line diff
--- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -262,14 +262,6 @@ that only one process prints to standard 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 @@ For an example of the usage of queues fo 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[](#l1.24)
implementation on the host operating system. Without one, the[](#l1.25)
functionality in this class will be disabled, and attempts to[](#l1.26)
instantiate a :class:`Queue` will result in an :exc:`ImportError`. See[](#l1.27)
:issue:`3770` for additional information. The same holds true for any[](#l1.28)
of the specialized queue types listed below.[](#l1.29)
.. class:: SimpleQueue()
@@ -1183,6 +1183,14 @@ object -- see :ref:multiprocessing-mana[](#l1.33) 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. +
--- a/Lib/multiprocessing/queues.py +++ b/Lib/multiprocessing/queues.py @@ -35,7 +35,8 @@ class Queue(object): def init(self, maxsize=0, *, ctx): if maxsize <= 0:
maxsize = _multiprocessing.SemLock.SEM_VALUE_MAX[](#l2.7)
# Can raise ImportError (see issues #3770 and #23400)[](#l2.8)
from .synchronize import SEM_VALUE_MAX as maxsize[](#l2.9) self._maxsize = maxsize[](#l2.10) self._reader, self._writer = connection.Pipe(duplex=False)[](#l2.11) self._rlock = ctx.Lock()[](#l2.12)
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -19,6 +19,9 @@ Core and Builtins Library ------- +- Issue #23400: Raise same exception on both Python 2 and 3 if sem_open is not