Skip to content

Commit

Permalink
main: added selector loop for asyncio on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
AnNEDoMini committed Oct 11, 2024
1 parent f701a03 commit b6c582b
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 logging
import os
import re
Expand Down Expand Up @@ -32,6 +33,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 b6c582b

Please sign in to comment.