From 0cc47bcad6d7653baba04b16aa763fb8a3028f78 Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Mon, 29 Feb 2016 00:37:26 -0500 Subject: [PATCH 1/2] Editor: Fix code completions when working with bootstrap --- spyderlib/utils/introspection/plugin_client.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/spyderlib/utils/introspection/plugin_client.py b/spyderlib/utils/introspection/plugin_client.py index 52ebf3810b1..ba2793e4470 100644 --- a/spyderlib/utils/introspection/plugin_client.py +++ b/spyderlib/utils/introspection/plugin_client.py @@ -7,11 +7,12 @@ import socket import errno import os +import os.path as osp import imp import sys # Local imports -from spyderlib.config.base import debug_print +from spyderlib.config.base import debug_print, DEV from spyderlib.utils.bsdsocket import read_packet, write_packet from spyderlib.qt.QtGui import QApplication from spyderlib.qt.QtCore import ( @@ -54,14 +55,9 @@ def start(self): self.process.setWorkingDirectory(os.path.dirname(__file__)) processEnvironment = QProcessEnvironment() env = self.process.systemEnvironment() - python_path = imp.find_module('spyderlib')[1] - # Use the current version of the plugin provider if possible. - try: - provider_path = imp.find_module(self.plugin_name)[1] - python_path = os.sep.join([python_path, provider_path]) - except ImportError: - pass - env.append("PYTHONPATH=%s" % python_path) + if DEV: + python_path = imp.find_module('spyderlib')[1] + env.append("PYTHONPATH=%s" % osp.dirname(python_path)) for envItem in env: envName, separator, envValue = envItem.partition('=') processEnvironment.insert(envName, envValue) From 9f2df9d196a63df6cfd5a64dc013aaa81b440a99 Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Mon, 29 Feb 2016 10:21:31 -0500 Subject: [PATCH 2/2] Editor: Restore Steve's code but fix it to make it work as expected --- spyderlib/utils/introspection/plugin_client.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/spyderlib/utils/introspection/plugin_client.py b/spyderlib/utils/introspection/plugin_client.py index ba2793e4470..3a12b9a7f2d 100644 --- a/spyderlib/utils/introspection/plugin_client.py +++ b/spyderlib/utils/introspection/plugin_client.py @@ -12,7 +12,7 @@ import sys # Local imports -from spyderlib.config.base import debug_print, DEV +from spyderlib.config.base import debug_print from spyderlib.utils.bsdsocket import read_packet, write_packet from spyderlib.qt.QtGui import QApplication from spyderlib.qt.QtCore import ( @@ -55,9 +55,14 @@ def start(self): self.process.setWorkingDirectory(os.path.dirname(__file__)) processEnvironment = QProcessEnvironment() env = self.process.systemEnvironment() - if DEV: - python_path = imp.find_module('spyderlib')[1] - env.append("PYTHONPATH=%s" % osp.dirname(python_path)) + python_path = osp.dirname(imp.find_module('spyderlib')[1]) + # Use the current version of the plugin provider if possible. + try: + provider_path = osp.dirname(imp.find_module(self.plugin_name)[1]) + python_path = osp.pathsep.join([python_path, provider_path]) + except ImportError: + pass + env.append("PYTHONPATH=%s" % python_path) for envItem in env: envName, separator, envValue = envItem.partition('=') processEnvironment.insert(envName, envValue)