Skip to content

Commit

Permalink
Restart PrEditor feature works when launched with python -m
Browse files Browse the repository at this point in the history
  • Loading branch information
MHendricks committed Mar 6, 2024
1 parent 908e3ff commit ea773dc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion preditor/gui/loggerwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,9 +721,15 @@ def restartLogger(self):
"""
self.close()

# Get the current command and launch it as a new process.
# Get the current command and launch it as a new process. This handles
# use of the preditor/preditor executable launchers.
cmd = sys.argv[0]
args = sys.argv[1:]

if os.path.basename(cmd) == "__main__.py":
# Handles using `python -m preditor` style launch.
cmd = sys.executable
args = ["-m", "preditor"] + args
QtCore.QProcess.startDetached(cmd, args)

def restorePrefs(self):
Expand Down

0 comments on commit ea773dc

Please sign in to comment.