Commit 1ab05faf by Tianqi Chen Committed by GitHub

[CYTHON] Fix exception propagation for cython3 (#1046)

parent 8084a4da
......@@ -64,8 +64,8 @@ ctypedef int (*TVMPackedCFunc)(
ctypedef void (*TVMPackedCFuncFinalizer)(void* resource_handle)
cdef extern from "tvm/runtime/c_runtime_api.h":
void TVMAPISetLastError(const char* msg);
const char *TVMGetLastError();
void TVMAPISetLastError(const char* msg)
const char *TVMGetLastError()
int TVMFuncCall(TVMFunctionHandle func,
TVMValue* arg_values,
int* type_codes,
......
......@@ -74,10 +74,10 @@ def convert_to_tvm_func(object pyfunc):
return ret
cdef inline void make_arg(object arg,
TVMValue* value,
int* tcode,
list temp_args):
cdef inline int make_arg(object arg,
TVMValue* value,
int* tcode,
list temp_args) except -1:
"""Pack arguments into c args tvm call accept"""
cdef unsigned long long ptr
if isinstance(arg, NodeBase):
......@@ -152,6 +152,7 @@ cdef inline void make_arg(object arg,
temp_args.append(arg)
else:
raise TypeError("Don't know how to handle type %s" % type(arg))
return 0
cdef inline bytearray make_ret_bytes(void* chandle):
handle = ctypes_handle(chandle)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment