From fbee194fd9cc25e7438e73896ba81020ef1dd266 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Tue, 14 Apr 2020 02:51:05 +0200 Subject: cython: Fix get_value for Data nodes --- cython/plist.pyx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'cython') 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) -- cgit v1.1-32-gdbae