From 45a4d04b7debe830518ea8ed23bc7255576211e5 2012-05-23 05:28:24 From: MinRK Date: 2012-05-23 05:28:24 Subject: [PATCH] use [sys.exe, "-c", "…launch_new_instance()"] in launchers instead of [sys.exe, module_path], which resulted in the modules being `__main__`, which caused problems. --- diff --git a/IPython/parallel/apps/launcher.py b/IPython/parallel/apps/launcher.py index 3a5a12e..0d8d2eb 100644 --- a/IPython/parallel/apps/launcher.py +++ b/IPython/parallel/apps/launcher.py @@ -24,6 +24,7 @@ import logging import os import re import stat +import sys import time # signal imports, handling various platforms, versions @@ -60,8 +61,8 @@ from IPython.utils.text import EvalFormatter from IPython.utils.traitlets import ( Any, Integer, CFloat, List, Unicode, Dict, Instance, HasTraits, ) -from IPython.utils.path import get_ipython_module_path, get_home_dir -from IPython.utils.process import find_cmd, pycmd2argv, FindCmdError +from IPython.utils.path import get_home_dir +from IPython.utils.process import find_cmd, FindCmdError from .win32support import forward_read_events @@ -73,18 +74,13 @@ WINDOWS = os.name == 'nt' # Paths to the kernel apps #----------------------------------------------------------------------------- +cmd = "from IPython.parallel.apps.%s import launch_new_instance; launch_new_instance()" -ipcluster_cmd_argv = pycmd2argv(get_ipython_module_path( - 'IPython.parallel.apps.ipclusterapp' -)) +ipcluster_cmd_argv = [sys.executable, "-c", cmd % "ipclusterapp"] -ipengine_cmd_argv = pycmd2argv(get_ipython_module_path( - 'IPython.parallel.apps.ipengineapp' -)) +ipengine_cmd_argv = [sys.executable, "-c", cmd % "ipengineapp"] -ipcontroller_cmd_argv = pycmd2argv(get_ipython_module_path( - 'IPython.parallel.apps.ipcontrollerapp' -)) +ipcontroller_cmd_argv = [sys.executable, "-c", cmd % "ipcontrollerapp"] #----------------------------------------------------------------------------- # Base launchers and errors