diff options
author | Richard Oudkerk <shibturn@gmail.com> | 2014-03-23 11:54:15 +0000 |
---|---|---|
committer | Richard Oudkerk <shibturn@gmail.com> | 2014-03-23 11:54:15 +0000 |
commit | 7fdadf68f1544817992c9f764424cd357dc1dc31 (patch) | |
tree | cb45c7f5b108372057776cf034574052c5e41b7a /Lib/multiprocessing/synchronize.py | |
parent | 409855f008fd10f3ccd53ff5b723898d641b8ecb (diff) | |
download | cpython-7fdadf68f1544817992c9f764424cd357dc1dc31.tar.gz |
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 0e3f6ec2e9..dea1cbd7f0 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( |