@@ -261,8 +261,8 @@ def get_all_start_methods(self):
261
261
"""Returns a list of the supported start methods, default first."""
262
262
default = self ._default_context .get_start_method ()
263
263
start_method_names = [default ]
264
- start_method_names += (
265
- name for name in _concrete_contexts if name != default
264
+ start_method_names . extend (
265
+ name for name in _concrete_contexts if name != default
266
266
)
267
267
return start_method_names
268
268
@@ -319,18 +319,15 @@ def _check_available(self):
319
319
'spawn' : SpawnContext (),
320
320
'forkserver' : ForkServerContext (),
321
321
}
322
- if sys .platform == 'darwin' :
323
- # bpo-33725: running arbitrary code after fork() is no longer reliable
324
- # on macOS since macOS 10.14 (Mojave). Use spawn by default instead.
325
- _default_context = DefaultContext (_concrete_contexts ['spawn' ])
322
+ # bpo-33725: running arbitrary code after fork() is no longer reliable
323
+ # on macOS since macOS 10.14 (Mojave). Use spawn by default instead.
324
+ # gh-84559: We changed everyones default to a thread safeish one in 3.14.
325
+ if reduction .HAVE_SEND_HANDLE and sys .platform != 'darwin' :
326
+ _default_context = DefaultContext (_concrete_contexts ['forkserver' ])
326
327
else :
327
- # gh-84559: We changed the default to a thread safe one in 3.14.
328
- if reduction .HAVE_SEND_HANDLE :
329
- _default_context = DefaultContext (_concrete_contexts ['forkserver' ])
330
- else :
331
- _default_context = DefaultContext (_concrete_contexts ['spawn' ])
328
+ _default_context = DefaultContext (_concrete_contexts ['spawn' ])
332
329
333
- else :
330
+ else : # Windows
334
331
335
332
class SpawnProcess (process .BaseProcess ):
336
333
_start_method = 'spawn'
0 commit comments