mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
qa: Consume stdin on Windows platforms
On Windows platforms, we can't consume the stdin using select(), because it's not available for pipes [1]. We can instead consume it using some native Windows calls. [1]: From https://docs.python.org/3/library/select.html#select.select: "File objects on Windows are not acceptable, but sockets are. On Windows, the underlying select() function is provided by the WinSock library, and does not handle file descriptors that don’t originate from WinSock."
This commit is contained in:
parent
04508d9694
commit
fd241e5964
1 changed files with 7 additions and 0 deletions
|
@ -724,6 +724,13 @@ class QAWindows(QABase):
|
||||||
|
|
||||||
REF_BUILD = Reference("BUILD.md", content=CONTENT_BUILD_WINDOWS)
|
REF_BUILD = Reference("BUILD.md", content=CONTENT_BUILD_WINDOWS)
|
||||||
|
|
||||||
|
def _consume_stdin(self):
|
||||||
|
# NOTE: We can't use select() on Windows. See:
|
||||||
|
# https://docs.python.org/3/library/select.html#select.select
|
||||||
|
import msvcrt
|
||||||
|
while msvcrt.kbhit():
|
||||||
|
msvcrt.getch()
|
||||||
|
|
||||||
@QABase.task("Install and Run Docker Desktop", ref=REF_BUILD)
|
@QABase.task("Install and Run Docker Desktop", ref=REF_BUILD)
|
||||||
def install_docker(self):
|
def install_docker(self):
|
||||||
logger.info("Checking if Docker Desktop is installed and running")
|
logger.info("Checking if Docker Desktop is installed and running")
|
||||||
|
|
Loading…
Reference in a new issue