Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -95,8 +95,10 @@ async def start_web_server():
|
|
95 |
if s.connect_ex(('localhost', port)) != 0:
|
96 |
break
|
97 |
port += 1
|
98 |
-
subprocess
|
|
|
|
|
99 |
|
100 |
if __name__ == "__main__":
|
101 |
discord_client = MyClient(intents=intents)
|
102 |
-
discord_client.run(os.getenv('DISCORD_TOKEN'))
|
|
|
95 |
if s.connect_ex(('localhost', port)) != 0:
|
96 |
break
|
97 |
port += 1
|
98 |
+
# subprocess를 통해 web.py 실행 시 python 대신 python3를 명시적으로 사용
|
99 |
+
python_executable = 'python3' if os.name == 'posix' else 'python'
|
100 |
+
subprocess.Popen([python_executable, "web.py"], env={"GRADIO_SERVER_PORT": str(port)})
|
101 |
|
102 |
if __name__ == "__main__":
|
103 |
discord_client = MyClient(intents=intents)
|
104 |
+
discord_client.run(os.getenv('DISCORD_TOKEN'))
|