Skip to content

Commit

Permalink
Merge pull request #1236 from AnNEDoMini/asyncio_selectort_loop
Browse files Browse the repository at this point in the history
cli: add selector loop for asyncio on Windows (#1217)
  • Loading branch information
doronz88 authored Oct 12, 2024
2 parents 2ee199f + 242c7ae commit ee60ca3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ See [CONTRIBUTING](https://github.com/doronz88/pymobiledevice3/blob/master/CONTR

Please see [misc](https://github.com/doronz88/pymobiledevice3/blob/master/misc)

Library uses WindowsSelectorEventLoopPolicy for asyncio on Windows platform. Please see discussion [misc](https://github.com/doronz88/pymobiledevice3/issues/1217)

## Copyright notice

This work is licensed under GPL 3.0, and as, credited to several major contributors:
Expand Down
5 changes: 5 additions & 0 deletions pymobiledevice3/__main__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import asyncio
import difflib
import logging
import os
Expand Down Expand Up @@ -33,6 +34,10 @@

logger = logging.getLogger(__name__)

# For issue https://github.com/doronz88/pymobiledevice3/issues/1217, details: https://bugs.python.org/issue37373
if sys.platform == 'win32':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

INVALID_SERVICE_MESSAGE = """Failed to start service. Possible reasons are:
- If you were trying to access a developer service (developer subcommand):
- If your device iOS version >= 15.0:
Expand Down

0 comments on commit ee60ca3

Please sign in to comment.