[Python-checkins] cpython (merge 3.2 -> default): Fix #5162. Allow child spawning from Windows services (via pywin32).
brian.curtin
python-checkins at python.org
Tue Apr 12 01:01:40 CEST 2011
http://hg.python.org/cpython/rev/3c2bdea18b5c
changeset: 69254:3c2bdea18b5c
parent: 69251:1e5e3bb3e1f1
parent: 69253:184ae02e3221
user: brian.curtin <brian at python.org>
date: Mon Apr 11 17:59:01 2011 -0500
summary:
Fix #5162. Allow child spawning from Windows services (via pywin32).
files:
Lib/multiprocessing/forking.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/Lib/multiprocessing/forking.py b/Lib/multiprocessing/forking.py
--- a/Lib/multiprocessing/forking.py
+++ b/Lib/multiprocessing/forking.py
@@ -195,6 +195,7 @@
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 @@
# 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 @@
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]
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list