Skip to content

Commit

Permalink
Merge pull request doronz88#811 from mic12130/fix/wait-return-on-win
Browse files Browse the repository at this point in the history
cli_common: Fix wait_return availability on Windows
  • Loading branch information
doronz88 authored Jan 28, 2024
2 parents b02cf19 + 0d262a2 commit 88ff187
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pymobiledevice3/cli/cli_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import json
import logging
import os
import signal
import sys
import uuid
from typing import Callable, List, Mapping, Optional, Tuple
Expand Down Expand Up @@ -94,9 +93,13 @@ def get_last_used_terminal_formatting(buf: str) -> str:
return '\x1b' + buf.rsplit('\x1b', 1)[1].split('m')[0] + 'm'


def wait_return():
print("Press Ctrl+C to send a SIGINT or use 'kill' command to send a SIGTERM")
signal.sigwait([signal.SIGINT, signal.SIGTERM])
def wait_return() -> None:
if sys.platform != 'win32':
import signal
print("Press Ctrl+C to send a SIGINT or use 'kill' command to send a SIGTERM")
signal.sigwait([signal.SIGINT, signal.SIGTERM])
else:
input('Press ENTER to exit>')


UDID_ENV_VAR = 'PYMOBILEDEVICE3_UDID'
Expand Down

0 comments on commit 88ff187

Please sign in to comment.