Skip to content

Commit

Permalink
Use full-path sys.executable rather than using basename.
Browse files Browse the repository at this point in the history
  • Loading branch information
itsTheFae committed Feb 4, 2024
1 parent d99b1c9 commit 5f20de1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def respawn_bot_process(pybin: str = "") -> None:
where the new bot is started, with a new PID, and exit this instance.
"""
if not pybin:
pybin = os.path.basename(sys.executable)
pybin = sys.executable
exec_args = [pybin] + sys.argv

shutdown_loggers()
Expand All @@ -383,7 +383,6 @@ def respawn_bot_process(pybin: str = "") -> None:
# The moment we end our existing instance, control is returned to the starting shell.
with subprocess.Popen(
exec_args,
# creationflags is only available under windows, so mypy may complain here.
creationflags=subprocess.CREATE_NEW_CONSOLE, # type: ignore[attr-defined]
):
log.debug("Opened new MusicBot instance. This terminal can now be closed!")
Expand Down

0 comments on commit 5f20de1

Please sign in to comment.