summaryrefslogtreecommitdiffstats
path: root/cython/plist.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'cython/plist.pyx')
-rw-r--r--cython/plist.pyx6
1 files changed, 1 insertions, 5 deletions
diff --git a/cython/plist.pyx b/cython/plist.pyx
index be3fe8a..bfecf85 100644
--- a/cython/plist.pyx
+++ b/cython/plist.pyx
@@ -2,10 +2,6 @@ cimport cpython
cimport libc.stdlib
from libc.stdint cimport *
-# https://groups.google.com/forum/#!topic/cython-users/xoKNFTRagvk
-cdef _from_string_and_size(char *s, size_t length):
- return s[:length].encode('utf-8')
-
cdef extern from *:
ctypedef enum plist_type:
PLIST_BOOLEAN,
@@ -553,7 +549,7 @@ cdef class Data(Node):
plist_get_data_val(self._c_node, &val, &length)
try:
- return _from_string_and_size(val, length)
+ return bytes(val[:length])
finally:
libc.stdlib.free(val)