1 parent ecfd8e1 commit 7053621Copy full SHA for 7053621
1 file changed
examples/unix/ffi_example.py
@@ -18,8 +18,8 @@
18
19
perror("ffi before error")
20
open("somethingnonexistent__", 0)
21
-print(errno)
22
-print(errno.get())
+print("errno object:", errno)
+print("errno value:", errno.get())
23
perror("ffi after error")
24
print()
25
@@ -32,8 +32,7 @@ def cmp(pa, pb):
32
cmp_c = ffi.callback("i", cmp, "pp")
33
print("callback:", cmp_c)
34
35
-# TODO: violates Py semantics, pass bytearray
36
-s = "foobar"
+s = bytearray(b"foobar")
37
print("org string:", s)
38
qsort(s, len(s), 1, cmp_c)
39
-print("qsort'ed:", s)
+print("qsort'ed string:", s)
0 commit comments