Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/graphviz/_compat.py: 80%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""Platform compatibility."""
3import sys
6def get_startupinfo() -> None:
7 """Return None for startupinfo argument of ``subprocess.Popen``."""
8 return None
11assert get_startupinfo() is None, 'get_startupinfo() defaults to a no-op' # type: ignore[func-returns-value] # noqa: E501
14# avoid platform.system() to work around https://github.com/python/mypy/issues/8166
15if sys.platform == 'win32' or sys.platform == 'cygwin' or sys.platform == 'msys': # pragma: no cover # noqa: E501
16 import subprocess
18 def get_startupinfo() -> subprocess.STARTUPINFO: # type: ignore[misc] # noqa: E501
19 """Return subprocess.STARTUPINFO instance hiding the console window."""
20 startupinfo = subprocess.STARTUPINFO()
21 startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
22 startupinfo.wShowWindow = subprocess.SW_HIDE
23 return startupinfo