diff options
author | Richard Oudkerk <shibturn@gmail.com> | 2014-03-23 11:54:15 (GMT) |
---|---|---|
committer | Richard Oudkerk <shibturn@gmail.com> | 2014-03-23 11:54:15 (GMT) |
commit | a40675a1a232479bbc2cb9437db265416eeb5b2d (patch) | |
tree | 298062361b79c40489fbf9a20e2d3398ead87a1e /Lib/multiprocessing/synchronize.py | |
parent | 75c5ab49edff23dacd1410062480c031afc80c9d (diff) | |
download | cpython-a40675a1a232479bbc2cb9437db265416eeb5b2d.zip cpython-a40675a1a232479bbc2cb9437db265416eeb5b2d.tar.gz cpython-a40675a1a232479bbc2cb9437db265416eeb5b2d.tar.bz2 |
Issue #20990: Fix issues found by pyflakes for multiprocessing.
Diffstat (limited to 'Lib/multiprocessing/synchronize.py')
-rw-r--r-- | Lib/multiprocessing/synchronize.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/multiprocessing/synchronize.py b/Lib/multiprocessing/synchronize.py index 0e3f6ec..dea1cbd 100644 --- a/Lib/multiprocessing/synchronize.py +++ b/Lib/multiprocessing/synchronize.py @@ -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( |