Skip to content

Commit

Permalink
Undo changes of PR spyder-ide#4263 because the python path isn't sett…
Browse files Browse the repository at this point in the history
…ed in the process enviroment.
  • Loading branch information
rlaverde committed Aug 15, 2017
1 parent 4c76735 commit 847f347
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
9 changes: 4 additions & 5 deletions spyder/utils/introspection/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ class PluginManager(QObject):

introspection_complete = Signal(object)

def __init__(self, executable, extra_path=None):
def __init__(self, executable):

super(PluginManager, self).__init__()
plugins = OrderedDict()
for name in PLUGINS:
try:
plugin = PluginClient(name, executable, extra_path=extra_path)
plugin = PluginClient(name, executable)
plugin.run()
except Exception as e:
debug_print('Introspection Plugin Failed: %s' % name)
Expand Down Expand Up @@ -173,7 +173,7 @@ def __init__(self, executable=None, extra_path=[]):
if self.extra_path:
self.sys_path.extend(extra_path)
self.executable = executable
self.plugin_manager = PluginManager(executable, extra_path)
self.plugin_manager = PluginManager(executable)
self.plugin_manager.introspection_complete.connect(
self._introspection_complete)

Expand All @@ -190,8 +190,7 @@ def change_extra_path(self, extra_path):

def _restart_plugin(self):
self.plugin_manager.close()
self.plugin_manager = PluginManager(self.executable,
extra_path=self.extra_path)
self.plugin_manager = PluginManager(self.executable)
self.plugin_manager.introspection_complete.connect(
self._introspection_complete)

Expand Down
19 changes: 5 additions & 14 deletions spyder/utils/introspection/plugin_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ class AsyncClient(QObject):
received = Signal(object)

def __init__(self, target, executable=None, name=None,
extra_args=None, libs=None, cwd=None, env=None,
extra_path=None):
extra_args=None, libs=None, cwd=None, env=None):
super(AsyncClient, self).__init__()
self.executable = executable or sys.executable
self.extra_args = extra_args
Expand All @@ -51,7 +50,6 @@ def __init__(self, target, executable=None, name=None,
self.libs = libs
self.cwd = cwd
self.env = env
self.extra_path = extra_path
self.is_initialized = False
self.closing = False
self.notifier = None
Expand Down Expand Up @@ -90,13 +88,6 @@ def run(self):
python_path = osp.pathsep.join([python_path, path])
except ImportError:
pass
if self.extra_path:
try:
python_path = osp.pathsep.join([python_path] +
self.extra_path)
except Exception as e:
debug_print("Error when adding extra_path to plugin env")
debug_print(e)
env.append("PYTHONPATH=%s" % python_path)
if self.env:
env.update(self.env)
Expand Down Expand Up @@ -211,10 +202,10 @@ class PluginClient(AsyncClient):
def __init__(self, plugin_name, executable=None, env=None,
extra_path=None):
cwd = os.path.dirname(__file__)
super(PluginClient, self).__init__('plugin_server.py',
executable=executable, cwd=cwd, env=env,
extra_args=[plugin_name], libs=[plugin_name],
extra_path=extra_path)
super(PluginClient, self).__init__(
'plugin_server.py',
executable=executable, cwd=cwd, env=env,
extra_args=[plugin_name], libs=[plugin_name])
self.name = plugin_name


Expand Down

0 comments on commit 847f347

Please sign in to comment.