From 20dd4301e696177d8575fb526968aac6b6ad44b2 Mon Sep 17 00:00:00 2001 From: Ales Teska Date: Fri, 22 Mar 2024 15:17:05 +0100 Subject: [PATCH] Fixes in addr_to_element --- cysimdjson/cysimdjson.pyx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cysimdjson/cysimdjson.pyx b/cysimdjson/cysimdjson.pyx index ab87d70..41289f2 100644 --- a/cysimdjson/cysimdjson.pyx +++ b/cysimdjson/cysimdjson.pyx @@ -125,7 +125,7 @@ cdef extern from "jsoninter.h": cdef const char * PyUnicode_AsUTF8AndSize(object, Py_ssize_t *) - cdef simdjson_element extract_element(void *) + cdef simdjson_element extract_element(void *) except + simdjson_error_handler cdef size_t element_addrof(simdjson_element & value) @@ -474,9 +474,7 @@ cdef public api object cysimdjson_addr_to_element(void * element): def addr_to_element(element_addr: int): - cdef char * e = NULL - e += element_addr - cdef simdjson_element v = extract_element(e) + cdef simdjson_element v = extract_element(element_addr) return JSONElement.from_element(v)