Skip to content

Commit 8788c41

Browse files
committed
pyRay : had to use some dynamic type comparison
1 parent 422b290 commit 8788c41

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pyray/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,13 @@ def to_str(value):
7070
return ffi.string(value).decode('utf-8')
7171

7272
def to_pointer(value):
73-
return ffi.addressof(value)
73+
if str(type(value)) == "<class '_cffi_backend.__CDataOwn'>":
74+
return ffi.addressof(value)
75+
return value
7476

7577

7678
def makeFunc(c_func):
77-
#print("makefunc ",a, ffi.typeof(a).args)
79+
#print("makefunc ", c_func, ffi.typeof(c_func).args)
7880

7981
# based on ctypes of arguments of the c function
8082
# we build a list of converters to call on python function arguments

0 commit comments

Comments
 (0)