From 1df0e4bfe86fde89772bf54d06c4546af85e303c Mon Sep 17 00:00:00 2001 From: wendyisgr33n Date: Mon, 30 Jul 2018 10:44:40 -0700 Subject: Fixed debugserver.pxi PyString_AsString compatibility with Python3 --- cython/debugserver.pxi | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cython/debugserver.pxi b/cython/debugserver.pxi index 4ecb9e1..a3b7d1e 100644 --- a/cython/debugserver.pxi +++ b/cython/debugserver.pxi @@ -44,7 +44,12 @@ cdef class DebugServerError(BaseError): # from http://stackoverflow.com/a/17511714 -from cpython.string cimport PyString_AsString +# https://github.com/libimobiledevice/libimobiledevice/pull/198 +from cpython cimport PY_MAJOR_VERSION +if PY_MAJOR_VERSION <= 2: + from cpython.string cimport PyString_AsString +else: + from cpython.bytes cimport PyBytes_AsString as PyString_AsString cdef char ** to_cstring_array(list_str): if not list_str: return NULL -- cgit v1.1-32-gdbae