diff options
| author | 2018-07-30 10:44:40 -0700 | |
|---|---|---|
| committer | 2021-01-03 23:26:52 +0100 | |
| commit | 1df0e4bfe86fde89772bf54d06c4546af85e303c (patch) | |
| tree | d3d20ff8b90ed280980abdad95e7dc9fbc4f0890 /cython | |
| parent | 7044571b4f243d2fda4dd3aa491f2f279787ee19 (diff) | |
| download | libimobiledevice-1df0e4bfe86fde89772bf54d06c4546af85e303c.tar.gz libimobiledevice-1df0e4bfe86fde89772bf54d06c4546af85e303c.tar.bz2 | |
Fixed debugserver.pxi PyString_AsString compatibility with Python3
Diffstat (limited to 'cython')
| -rw-r--r-- | cython/debugserver.pxi | 7 |
1 files changed, 6 insertions, 1 deletions
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): | |||
| 44 | 44 | ||
| 45 | 45 | ||
| 46 | # from http://stackoverflow.com/a/17511714 | 46 | # from http://stackoverflow.com/a/17511714 |
| 47 | from cpython.string cimport PyString_AsString | 47 | # https://github.com/libimobiledevice/libimobiledevice/pull/198 |
| 48 | from cpython cimport PY_MAJOR_VERSION | ||
| 49 | if PY_MAJOR_VERSION <= 2: | ||
| 50 | from cpython.string cimport PyString_AsString | ||
| 51 | else: | ||
| 52 | from cpython.bytes cimport PyBytes_AsString as PyString_AsString | ||
| 48 | cdef char ** to_cstring_array(list_str): | 53 | cdef char ** to_cstring_array(list_str): |
| 49 | if not list_str: | 54 | if not list_str: |
| 50 | return NULL | 55 | return NULL |
