diff options
author | brian.curtin <brian@python.org> | 2011-04-11 18:00:59 -0500 |
---|---|---|
committer | brian.curtin <brian@python.org> | 2011-04-11 18:00:59 -0500 |
commit | 6b5ced95dbd5b917da08e0678bc314f1ea9dd3f1 (patch) | |
tree | 5e838605f4f72d89f5386df0787284a23317137e /Lib/multiprocessing | |
parent | 37a7abf45f56e2853e8784142addd18bc42e8338 (diff) | |
download | cpython-6b5ced95dbd5b917da08e0678bc314f1ea9dd3f1.tar.gz |
Fix #5162. Allow child spawning from Windows services (via pywin32).
Diffstat (limited to 'Lib/multiprocessing')
-rw-r--r-- | Lib/multiprocessing/forking.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/multiprocessing/forking.py b/Lib/multiprocessing/forking.py index d5f3b26437..3fca8b1132 100644 --- a/Lib/multiprocessing/forking.py +++ b/Lib/multiprocessing/forking.py @@ -198,6 +198,7 @@ else: TERMINATE = 0x10000 WINEXE = (sys.platform == 'win32' and getattr(sys, 'frozen', False)) + WINSERVICE = sys.executable.lower().endswith("pythonservice.exe") exit = win32.ExitProcess close = win32.CloseHandle @@ -207,7 +208,7 @@ else: # People embedding Python want to modify it. # - if sys.executable.lower().endswith('pythonservice.exe'): + if WINSERVICE: _python_exe = os.path.join(sys.exec_prefix, 'python.exe') else: _python_exe = sys.executable @@ -397,7 +398,7 @@ else: if _logger is not None: d['log_level'] = _logger.getEffectiveLevel() - if not WINEXE: + if not WINEXE and not WINSERVICE: main_path = getattr(sys.modules['__main__'], '__file__', None) if not main_path and sys.argv[0] not in ('', '-c'): main_path = sys.argv[0] |