summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar wendyisgr33n2018-07-30 10:45:55 -0700
committerGravatar Nikias Bassen2021-01-03 23:26:52 +0100
commit652dfdb12ebcdec64dba066550d893de17839365 (patch)
treea707f19ab52f1e18fe222c2f4767bb2867f28965
parent88ea0e3b553c26bddb7e49ec2aac6197c84aab25 (diff)
downloadlibimobiledevice-652dfdb12ebcdec64dba066550d893de17839365.tar.gz
libimobiledevice-652dfdb12ebcdec64dba066550d893de17839365.tar.bz2
Fixed bytes/strings checks in lockdown.pxi for compatibility with Python2/3
-rw-r--r--cython/lockdown.pxi6
1 files changed, 3 insertions, 3 deletions
diff --git a/cython/lockdown.pxi b/cython/lockdown.pxi
index f249049..1bf7072 100644
--- a/cython/lockdown.pxi
+++ b/cython/lockdown.pxi
@@ -230,9 +230,9 @@ cdef class LockdownClient(PropertyListService):
if issubclass(service, BaseService) and \
service.__service_name__ is not None \
- and isinstance(service.__service_name__, basestring):
+ and isinstance(service.__service_name__, (str, bytes)):
c_service_name = <bytes>service.__service_name__
- elif isinstance(service, basestring):
+ elif isinstance(service, (str, bytes)):
c_service_name = <bytes>service
else:
raise TypeError("LockdownClient.start_service() takes a BaseService or string as its first argument")
@@ -253,7 +253,7 @@ cdef class LockdownClient(PropertyListService):
if not hasattr(service_class, '__service_name__') and \
not service_class.__service_name__ is not None \
- and not isinstance(service_class.__service_name__, basestring):
+ and not isinstance(service_class.__service_name__, (str, bytes)):
raise TypeError("LockdownClient.get_service_client() takes a BaseService as its first argument")
descriptor = self.start_service(service_class)