Skip to content

Commit

Permalink
Merge from 5.x: PR #18031
Browse files Browse the repository at this point in the history
Fixes #18010
  • Loading branch information
ccordoba12 committed Jun 28, 2022
2 parents a720c85 + 847c9f9 commit 2bda400
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions spyder/plugins/profiler/widgets/main_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from spyder.api.translations import get_translation
from spyder.api.widgets.main_widget import PluginMainWidget
from spyder.api.widgets.mixins import SpyderWidgetMixin
from spyder.config.base import get_conf_path
from spyder.config.base import get_conf_path, running_in_mac_app
from spyder.plugins.variableexplorer.widgets.texteditor import TextEditor
from spyder.py3compat import to_text_string
from spyder.utils.misc import get_python_executable, getcwd_or_home
Expand Down Expand Up @@ -543,6 +543,13 @@ def start(self, wdir=None, args=None, pythonpath=None):
proc_env.insert('PYTHONPATH', os.pathsep.join(pythonpath))
self.process.setProcessEnvironment(proc_env)

executable = self.get_conf('executable', section='main_interpreter')

if not running_in_mac_app(executable):
env = self.process.processEnvironment()
env.remove('PYTHONHOME')
self.process.setProcessEnvironment(env)

self.output = ''
self.error_output = ''
self.running = True
Expand All @@ -560,8 +567,6 @@ def start(self, wdir=None, args=None, pythonpath=None):
if args:
p_args.extend(shell_split(args))

executable = self.get_conf('executable', section='main_interpreter')

self.process.start(executable, p_args)
running = self.process.waitForStarted()
if not running:
Expand Down

0 comments on commit 2bda400

Please sign in to comment.