Skip to content

Commit d307a45

Browse files
committed
cli: fix ignoring ImportError
1 parent 88ff187 commit d307a45

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pymobiledevice3/__main__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
'remote': 'remote',
6565
'restore': 'restore',
6666
'springboard': 'springboard',
67-
'status': 'status',
6867
'syslog': 'syslog',
6968
'usbmux': 'usbmux',
7069
'webinspector': 'webinspector',
@@ -79,10 +78,7 @@ def list_commands(self, ctx):
7978
def get_command(self, ctx, name):
8079
if name not in CLI_GROUPS.keys():
8180
ctx.fail(f'No such command {name!r}.')
82-
try:
83-
mod = __import__(f'pymobiledevice3.cli.{CLI_GROUPS[name]}', None, None, ['cli'])
84-
except ImportError:
85-
return
81+
mod = __import__(f'pymobiledevice3.cli.{CLI_GROUPS[name]}', None, None, ['cli'])
8682
command = mod.cli.get_command(ctx, name)
8783
# Some cli groups have different names than the index
8884
if not command:

pymobiledevice3/remote/core_device_tunnel_service.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
from asyncio import CancelledError, StreamReader, StreamWriter
1515
from collections import namedtuple
1616
from contextlib import asynccontextmanager, suppress
17-
from os import chown, getenv
17+
18+
if sys.platform != 'win32':
19+
from os import chown
20+
21+
from os import getenv
1822
from pathlib import Path
1923
from socket import AF_INET6, create_connection
2024
from ssl import VerifyMode

0 commit comments

Comments
 (0)