Skip to content

Commit 89475f7

Browse files
committed
Merge from 5.x: PR #21783
Fixes #21749
2 parents 22f7e56 + 75e5b60 commit 89475f7

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

spyder/plugins/ipythonconsole/utils/kernelspec.py

+1-15
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import logging
1313
import os
1414
import os.path as osp
15-
import sys
1615

1716
# Third party imports
1817
from jupyter_client.kernelspec import KernelSpec
@@ -56,16 +55,6 @@
5655
"</pre>")
5756

5857

59-
def is_different_interpreter(pyexec):
60-
"""Check that pyexec is a different interpreter from sys.executable."""
61-
# Paths may be symlinks
62-
real_pyexe = osp.realpath(pyexec)
63-
real_sys_exe = osp.realpath(sys.executable)
64-
executable_validation = osp.basename(real_pyexe).startswith('python')
65-
directory_validation = osp.dirname(real_pyexe) != osp.dirname(real_sys_exe)
66-
return directory_validation and executable_validation
67-
68-
6958
def has_spyder_kernels(pyexec):
7059
"""Check if env has spyder kernels."""
7160
if is_module_installed(
@@ -127,9 +116,6 @@ def argv(self):
127116
self.set_conf('default', True, section='main_interpreter')
128117
self.set_conf('custom', False, section='main_interpreter')
129118

130-
# Part of spyder-ide/spyder#11819
131-
is_different = is_different_interpreter(pyexec)
132-
133119
# Command used to start kernels
134120
kernel_cmd = [
135121
pyexec,
@@ -140,7 +126,7 @@ def argv(self):
140126
'-f', '{connection_file}'
141127
]
142128

143-
if is_different and is_conda_env(pyexec=pyexec):
129+
if is_conda_env(pyexec=pyexec):
144130
# If executable is a conda environment and different from Spyder's
145131
# runtime environment, we need to activate the environment to run
146132
# spyder-kernels

0 commit comments

Comments
 (0)