Issue #20990: Fix issues found by pyflakes for multiprocessing.

This commit is contained in:
Richard Oudkerk 2014-03-23 11:54:15 +00:00
parent 75c5ab49ed
commit a40675a1a2
3 changed files with 16 additions and 5 deletions

View file

@ -49,9 +49,10 @@ class SemLock(object):
_rand = tempfile._RandomNameSequence()
def __init__(self, kind, value, maxvalue, *, ctx):
ctx = ctx or get_context()
ctx = ctx.get_context()
unlink_now = sys.platform == 'win32' or ctx._name == 'fork'
if ctx is None:
ctx = context._default_context.get_context()
name = ctx.get_start_method()
unlink_now = sys.platform == 'win32' or name == 'fork'
for i in range(100):
try:
sl = self._semlock = _multiprocessing.SemLock(