diff options
author | Dave Nicolson | 2023-11-23 22:28:49 +0100 |
---|---|---|
committer | Nikias Bassen | 2023-12-16 00:33:05 +0100 |
commit | a7f993d45cf1516a2ed6c82fcddd9677984a65c8 (patch) | |
tree | 9b587dc973a5d126b197f86e5f968f1be343dfa8 | |
parent | 8819a300a0060229f9db1dda663d4e4b2b80b8e0 (diff) | |
download | libimobiledevice-a7f993d45cf1516a2ed6c82fcddd9677984a65c8.tar.gz libimobiledevice-a7f993d45cf1516a2ed6c82fcddd9677984a65c8.tar.bz2 |
cython: Fix Python 3 LockdownClient exception
Fixes #1110
-rw-r--r-- | cython/lockdown.pxi | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cython/lockdown.pxi b/cython/lockdown.pxi index 1bf7072..6b88f9d 100644 --- a/cython/lockdown.pxi +++ b/cython/lockdown.pxi @@ -231,11 +231,12 @@ cdef class LockdownClient(PropertyListService): if issubclass(service, BaseService) and \ service.__service_name__ is not None \ and isinstance(service.__service_name__, (str, bytes)): - c_service_name = <bytes>service.__service_name__ + c_service_name_str = service.__service_name__.encode('utf-8') elif isinstance(service, (str, bytes)): - c_service_name = <bytes>service + c_service_name_str = service.encode('utf-8') else: raise TypeError("LockdownClient.start_service() takes a BaseService or string as its first argument") + c_service_name = c_service_name_str try: self.handle_error(lockdownd_start_service(self._c_client, c_service_name, &c_descriptor)) |