diff options
author | 2023-11-23 22:28:49 +0100 | |
---|---|---|
committer | 2023-12-16 00:33:05 +0100 | |
commit | a7f993d45cf1516a2ed6c82fcddd9677984a65c8 (patch) | |
tree | 9b587dc973a5d126b197f86e5f968f1be343dfa8 /cython/lockdown.pxi | |
parent | 8819a300a0060229f9db1dda663d4e4b2b80b8e0 (diff) | |
download | libimobiledevice-a7f993d45cf1516a2ed6c82fcddd9677984a65c8.tar.gz libimobiledevice-a7f993d45cf1516a2ed6c82fcddd9677984a65c8.tar.bz2 |
cython: Fix Python 3 LockdownClient exception
Fixes #1110
Diffstat (limited to 'cython/lockdown.pxi')
-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): | |||
231 | if issubclass(service, BaseService) and \ | 231 | if issubclass(service, BaseService) and \ |
232 | service.__service_name__ is not None \ | 232 | service.__service_name__ is not None \ |
233 | and isinstance(service.__service_name__, (str, bytes)): | 233 | and isinstance(service.__service_name__, (str, bytes)): |
234 | c_service_name = <bytes>service.__service_name__ | 234 | c_service_name_str = service.__service_name__.encode('utf-8') |
235 | elif isinstance(service, (str, bytes)): | 235 | elif isinstance(service, (str, bytes)): |
236 | c_service_name = <bytes>service | 236 | c_service_name_str = service.encode('utf-8') |
237 | else: | 237 | else: |
238 | raise TypeError("LockdownClient.start_service() takes a BaseService or string as its first argument") | 238 | raise TypeError("LockdownClient.start_service() takes a BaseService or string as its first argument") |
239 | c_service_name = c_service_name_str | ||
239 | 240 | ||
240 | try: | 241 | try: |
241 | self.handle_error(lockdownd_start_service(self._c_client, c_service_name, &c_descriptor)) | 242 | self.handle_error(lockdownd_start_service(self._c_client, c_service_name, &c_descriptor)) |