From: Marc Schlaich Date: Fri, 19 May 2017 00:40:16 +0000 (+0200) Subject: bpo-26434: Fix multiprocessing grandchilds in a Windows service (GH-1167) X-Git-Tag: v2.7.14rc1~140 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c47c315812b1fa9acb16510a7aa3b37d113def48;p=thirdparty%2FPython%2Fcpython.git bpo-26434: Fix multiprocessing grandchilds in a Windows service (GH-1167) Patch by Davin with help from Marc. --- diff --git a/Lib/multiprocessing/forking.py b/Lib/multiprocessing/forking.py index d393817bb34d..9412eb1eff26 100644 --- a/Lib/multiprocessing/forking.py +++ b/Lib/multiprocessing/forking.py @@ -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]