Commit dc916c5d authored by Armin Rigo's avatar Armin Rigo
Browse files

Python 3 compatibility

parent 57afc244cbc2
......@@ -62,7 +62,7 @@ class TestFFI(backend_tests.BackendTests,
seen = []
def myalloc(size):
seen.append(size)
return ffi.new("char[]", "X" * size)
return ffi.new("char[]", b"X" * size)
def myfree(raw):
seen.append(raw)
alloc1 = ffi.new_allocator(myalloc, myfree)
......@@ -94,7 +94,7 @@ class TestFFI(backend_tests.BackendTests,
seen = []
def myalloc(size):
seen.append(size)
return ffi.new("char[]", "X" * size)
return ffi.new("char[]", b"X" * size)
alloc1 = ffi.new_allocator(myalloc) # no 'free'
p1 = alloc1("int[10]")
assert seen == [40]
......
......@@ -251,7 +251,7 @@ def test_ffi_new_allocator_2():
seen = []
def myalloc(size):
seen.append(size)
return ffi.new("char[]", "X" * size)
return ffi.new("char[]", b"X" * size)
def myfree(raw):
seen.append(raw)
alloc1 = ffi.new_allocator(myalloc, myfree)
......@@ -283,7 +283,7 @@ def test_ffi_new_allocator_3():
seen = []
def myalloc(size):
seen.append(size)
return ffi.new("char[]", "X" * size)
return ffi.new("char[]", b"X" * size)
alloc1 = ffi.new_allocator(myalloc) # no 'free'
p1 = alloc1("int[10]")
assert seen == [40]
......
......@@ -1115,7 +1115,8 @@ def test_macro_var_callback():
#
@ffi.callback("int *(*)(void)")
def get_my_value():
return values + it.next()
for nextvalue in it:
return values + nextvalue
lib.get_my_value = get_my_value
#
values[0] = 41
......
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