use typedefs when constructing structs

This commit is contained in:
Richard Smith 2025-05-27 14:53:20 +01:00
parent d3fcb40408
commit 11c5b1a728
2 changed files with 3 additions and 1 deletions

View file

@ -126,7 +126,7 @@ def _make_struct_constructor_function(struct):
or isinstance(arg, (array, bytes, bytearray, memoryview)))):
arg = ffi.from_buffer(field[1].type, arg)
modified_args.append(arg)
s = ffi.new(f"struct {struct} *", modified_args)[0]
s = ffi.new(f"{struct} *", modified_args)[0]
global_weakkeydict[s] = modified_args
return s