Skip to content

Commit

Permalink
Fix cli listen command on windows (python-ring-doorbell#437)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdb9696 committed Sep 13, 2024
1 parent 135b605 commit c908e3b
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions ring_doorbell/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,23 +657,7 @@ async def ainput(string: str):
loop = asyncio.get_event_loop()
await loop.run_in_executor(None, lambda s=string: sys.stdout.write(s + " ")) # type: ignore[misc]

def read_with_timeout(timeout):
if select.select(
[
sys.stdin,
],
[],
[],
timeout,
)[0]:
# line = sys.stdin.next()
return sys.stdin.readline()
return None

line = None
while loop.is_running() and not line:
line = await loop.run_in_executor(None, functools.partial(read_with_timeout, 1))
return line
return await loop.run_in_executor(None, sys.stdin.readline)


def get_now_str():
Expand Down

0 comments on commit c908e3b

Please sign in to comment.