fix resourcewarning

This commit is contained in:
Willem Melching 2020-05-15 15:21:05 -07:00
parent a91d0fc9b6
commit 6c9a85c387
1 changed files with 3 additions and 1 deletions

View File

@ -15,7 +15,9 @@ def write_code(folder, name, code, header):
def load_code(folder, name):
shared_fn = os.path.join(folder, f"lib{name}.so")
header_fn = os.path.join(folder, f"{name}.h")
header = open(header_fn).read()
with open(header_fn) as f:
header = f.read()
ffi = FFI()
ffi.cdef(header)