morshu-server: fix startup by passing env and using sys.executable
This commit is contained in:
+6
-1
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
import sys
|
||||
import shutil
|
||||
import logging
|
||||
import asyncio
|
||||
@@ -527,10 +528,14 @@ class TtsToy(Cog):
|
||||
log.error(f"Morshu server not found: {server_py}")
|
||||
return False
|
||||
|
||||
env = os.environ.copy()
|
||||
env['PORT'] = str(self.morshu_port)
|
||||
|
||||
self.morshu_process = await asyncio.to_thread(
|
||||
subprocess.Popen,
|
||||
["python3", "server.py"],
|
||||
[sys.executable, "server.py"],
|
||||
cwd=str(self.morshu_dir),
|
||||
env=env,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
text=True
|
||||
|
||||
Reference in New Issue
Block a user