mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue #20990: Fix issues found by pyflakes for multiprocessing.
This commit is contained in:
parent
75c5ab49ed
commit
a40675a1a2
3 changed files with 16 additions and 5 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue