]> granicus.if.org Git - python/commitdiff
bpo-26434: Fix multiprocessing grandchilds in a Windows service (GH-1167)
authorMarc Schlaich <marc.schlaich@googlemail.com>
Fri, 19 May 2017 00:40:16 +0000 (02:40 +0200)
committerDavin Potts <applio@users.noreply.github.com>
Fri, 19 May 2017 00:40:16 +0000 (19:40 -0500)
Patch by Davin with help from Marc.

Lib/multiprocessing/forking.py

index d393817bb34db1ebd5e11d8cec89b3a681037cdb..9412eb1eff26102fe7eb59899601579591977515 100644 (file)
@@ -405,7 +405,8 @@ else:
         if _logger is not None:
             d['log_level'] = _logger.getEffectiveLevel()
 
-        if not WINEXE and not WINSERVICE:
+        if not WINEXE and not WINSERVICE and \
+           not d['sys_argv'][0].lower().endswith('pythonservice.exe'):
             main_path = getattr(sys.modules['__main__'], '__file__', None)
             if not main_path and sys.argv[0] not in ('', '-c'):
                 main_path = sys.argv[0]