summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorbrian.curtin <brian@python.org>2011-04-11 22:59:01 (GMT)
committerbrian.curtin <brian@python.org>2011-04-11 22:59:01 (GMT)
commit80e478362be640dd5e2d351e80984261759e1b77 (patch)
tree1eb520ff0e3035012b7dee958e2bb490b6b190ab /Lib
parent2498c9f06e4adfa121e169127f2a729e8ef3250b (diff)
parent727b498102ff1d6e9055f203314307a33677578d (diff)
downloadcpython-80e478362be640dd5e2d351e80984261759e1b77.zip
cpython-80e478362be640dd5e2d351e80984261759e1b77.tar.gz
cpython-80e478362be640dd5e2d351e80984261759e1b77.tar.bz2
Fix #5162. Allow child spawning from Windows services (via pywin32).
Diffstat (limited to 'Lib')
-rw-r--r--Lib/multiprocessing/forking.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/multiprocessing/forking.py b/Lib/multiprocessing/forking.py
index 8ddddb6..cc7c326 100644
--- a/Lib/multiprocessing/forking.py
+++ b/Lib/multiprocessing/forking.py
@@ -195,6 +195,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
@@ -204,7 +205,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
@@ -394,7 +395,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]