Skip to content

Commit

Permalink
Fix restart error on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
xfangfang committed Jan 13, 2022
1 parent 2171c94 commit 937891b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions macast/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,12 @@ def restart():
Setting.stop_service()
executable = sys.executable[:-6] + 'Macast'
os.execv(executable, [executable, executable])
elif sys.platform == 'linux' and getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'):
# run from pyinstaller build on linux
Setting.stop_service()
env = Setting.get_system_env()
executable = sys.executable
os.execve(executable, [executable, executable], env)
else:
cherrypy.engine.restart()

Expand Down

0 comments on commit 937891b

Please sign in to comment.