File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 16
16
import io
17
17
import json
18
18
import os
19
+ import subprocess
19
20
import sys
20
21
from abc import ABC , abstractmethod
21
22
from pathlib import Path
@@ -97,6 +98,10 @@ async def wait_until_stopped(self) -> None:
97
98
98
99
async def run (self ) -> None :
99
100
self ._stopped_future : asyncio .Future = asyncio .Future ()
101
+ # Hide the command-line window on Windows when using Pythonw.exe
102
+ creationflags = 0
103
+ if sys .platform == "win32" and sys .stdout is None :
104
+ creationflags = subprocess .CREATE_NO_WINDOW
100
105
101
106
try :
102
107
self ._proc = proc = await asyncio .create_subprocess_exec (
@@ -106,6 +111,7 @@ async def run(self) -> None:
106
111
stdout = asyncio .subprocess .PIPE ,
107
112
stderr = _get_stderr_fileno (),
108
113
limit = 32768 ,
114
+ creationflags = creationflags ,
109
115
)
110
116
except Exception as exc :
111
117
self .on_error_future .set_exception (exc )
You can’t perform that action at this time.
0 commit comments