Skip to content

Commit 7bfe4b2

Browse files
committed
tests: Make ffi_callback.py be able to run on uclibc and macosx.
Similar to ffi_float.py.
1 parent 58056b0 commit 7bfe4b2

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

tests/unix/ffi_callback.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,18 @@
55
print("SKIP")
66
sys.exit()
77

8-
libc = ffi.open("libc.so.6")
8+
9+
def ffi_open(names):
10+
err = None
11+
for n in names:
12+
try:
13+
mod = ffi.open(n)
14+
return mod
15+
except OSError as e:
16+
err = e
17+
raise err
18+
19+
libc = ffi_open(('libc.so', 'libc.so.0', 'libc.so.6', 'libc.dylib'))
920

1021
qsort = libc.func("v", "qsort", "piip")
1122

0 commit comments

Comments
 (0)