Skip to content

Commit 7053621

Browse files
committed
examples/unix/ffi_example.py: Remove TODO, make output more clear.
1 parent ecfd8e1 commit 7053621

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

examples/unix/ffi_example.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
perror("ffi before error")
2020
open("somethingnonexistent__", 0)
21-
print(errno)
22-
print(errno.get())
21+
print("errno object:", errno)
22+
print("errno value:", errno.get())
2323
perror("ffi after error")
2424
print()
2525

@@ -32,8 +32,7 @@ def cmp(pa, pb):
3232
cmp_c = ffi.callback("i", cmp, "pp")
3333
print("callback:", cmp_c)
3434

35-
# TODO: violates Py semantics, pass bytearray
36-
s = "foobar"
35+
s = bytearray(b"foobar")
3736
print("org string:", s)
3837
qsort(s, len(s), 1, cmp_c)
39-
print("qsort'ed:", s)
38+
print("qsort'ed string:", s)

0 commit comments

Comments
 (0)