File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616import io
1717import json
1818import os
19+ import subprocess
1920import sys
2021from abc import ABC , abstractmethod
2122from pathlib import Path
@@ -113,6 +114,12 @@ async def connect(self) -> None:
113114 if getattr (sys , "frozen" , False ):
114115 env .setdefault ("PLAYWRIGHT_BROWSERS_PATH" , "0" )
115116
117+ startupinfo = None
118+ if sys .platform == "win32" :
119+ startupinfo = subprocess .STARTUPINFO ()
120+ startupinfo .dwFlags |= subprocess .STARTF_USESHOWWINDOW
121+ startupinfo .wShowWindow = subprocess .SW_HIDE
122+
116123 self ._proc = await asyncio .create_subprocess_exec (
117124 str (self ._driver_executable ),
118125 "run-driver" ,
@@ -121,6 +128,7 @@ async def connect(self) -> None:
121128 stderr = _get_stderr_fileno (),
122129 limit = 32768 ,
123130 env = env ,
131+ startupinfo = startupinfo ,
124132 )
125133 except Exception as exc :
126134 self .on_error_future .set_exception (exc )
You can’t perform that action at this time.
0 commit comments