Skip to content

Commit

Permalink
Name of function didn't make sense because it doesn't call sys.execut…
Browse files Browse the repository at this point in the history
…able and takes in any path
  • Loading branch information
bucknerns committed Feb 28, 2022
1 parent 506ca3c commit 3e572a4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions IPython/core/interactiveshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,16 +759,16 @@ def init_displayhook(self):
self.display_trap = DisplayTrap(hook=self.displayhook)

@staticmethod
def get_python_link_paths(p: Path):
"""Gets python paths including symlinks
def get_path_links(p: Path):
"""Gets path links including all symlinks
Examples
--------
In [1]: from IPython.core.interactiveshell import InteractiveShell
In [2]: import sys, pathlib
In [3]: paths = InteractiveShell.get_python_link_paths(pathlib.Path(sys.executable))
In [3]: paths = InteractiveShell.get_path_links(pathlib.Path(sys.executable))
In [4]: len(paths) == len(set(paths))
Out[4]: True
Expand Down Expand Up @@ -810,7 +810,7 @@ def init_virtualenv(self):
# stdlib venv may symlink sys.executable, so we can't use realpath.
# but others can symlink *to* the venv Python, so we can't just use sys.executable.
# So we just check every item in the symlink tree (generally <= 3)
paths = self.get_python_link_paths(p)
paths = self.get_path_links(p)

# In Cygwin paths like "c:\..." and '\cygdrive\c\...' are possible
if p_venv.parts[1] == "cygdrive":
Expand Down

0 comments on commit 3e572a4

Please sign in to comment.