##// END OF EJS Templates
Fix for symlink resolving
Nathan Buckner -
Show More
@@ -772,10 +772,13 b' class InteractiveShell(SingletonConfigurable):'
772 # stdlib venv may symlink sys.executable, so we can't use realpath.
772 # stdlib venv may symlink sys.executable, so we can't use realpath.
773 # but others can symlink *to* the venv Python, so we can't just use sys.executable.
773 # but others can symlink *to* the venv Python, so we can't just use sys.executable.
774 # So we just check every item in the symlink tree (generally <= 3)
774 # So we just check every item in the symlink tree (generally <= 3)
775 current_dir = Path(os.curdir).absolute()
775 paths = [p]
776 paths = [p]
776 while p.is_symlink():
777 while p.is_symlink():
777 p = Path(os.readlink(p))
778 os.chdir(p.parent)
778 paths.append(p.resolve())
779 p = Path(os.readlink(p)).absolute()
780 paths.append(p)
781 os.chdir(current_dir)
779
782
780 # In Cygwin paths like "c:\..." and '\cygdrive\c\...' are possible
783 # In Cygwin paths like "c:\..." and '\cygdrive\c\...' are possible
781 if p_venv.parts[1] == "cygdrive":
784 if p_venv.parts[1] == "cygdrive":
General Comments 0
You need to be logged in to leave comments. Login now