Issue #23400: Raise same exception on both Python 2 and 3 if sem_open is not available.

Patch by Davin Potts.
This commit is contained in:
Berker Peksag 2015-04-08 17:56:30 +03:00
parent 52c0c3382d
commit 7ecfc82edb
3 changed files with 21 additions and 9 deletions

View file

@ -35,7 +35,8 @@ class Queue(object):
def __init__(self, maxsize=0, *, ctx):
if maxsize <= 0:
maxsize = _multiprocessing.SemLock.SEM_VALUE_MAX
# Can raise ImportError (see issues #3770 and #23400)
from .synchronize import SEM_VALUE_MAX as maxsize
self._maxsize = maxsize
self._reader, self._writer = connection.Pipe(duplex=False)
self._rlock = ctx.Lock()