Skip to content

Commit

Permalink
More careful get_base_executable
Browse files Browse the repository at this point in the history
  • Loading branch information
aivarannamaa committed Feb 15, 2022
1 parent 9d027ca commit 1e70954
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions thonny/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,14 @@ def get_base_executable():
return sys.executable

if sys.platform == "win32":
result = sys.base_exec_prefix + "\\" + os.path.basename(sys.executable)
return normpath_with_actual_case(result)
elif os.path.islink(sys.executable):
guess = sys.base_exec_prefix + "\\" + os.path.basename(sys.executable)
if os.path.isfile(guess):
return normpath_with_actual_case(guess)

if os.path.islink(sys.executable):
return os.path.realpath(sys.executable)
else:
raise RuntimeError("Don't know how to locate base executable")

raise RuntimeError("Don't know how to locate base executable")


def get_augmented_system_path(extra_dirs):
Expand Down

0 comments on commit 1e70954

Please sign in to comment.