Skip to content

Commit c47c315

Browse files
schlamarapplio
authored andcommitted
bpo-26434: Fix multiprocessing grandchilds in a Windows service (GH-1167)
Patch by Davin with help from Marc.
1 parent dfcfc91 commit c47c315

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/multiprocessing/forking.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,8 @@ def get_preparation_data(name):
405405
if _logger is not None:
406406
d['log_level'] = _logger.getEffectiveLevel()
407407

408-
if not WINEXE and not WINSERVICE:
408+
if not WINEXE and not WINSERVICE and \
409+
not d['sys_argv'][0].lower().endswith('pythonservice.exe'):
409410
main_path = getattr(sys.modules['__main__'], '__file__', None)
410411
if not main_path and sys.argv[0] not in ('', '-c'):
411412
main_path = sys.argv[0]

0 commit comments

Comments
 (0)