diff --git a/rednose/helpers/__init__.py b/rednose/helpers/__init__.py index 0634321..1588a43 100644 --- a/rednose/helpers/__init__.py +++ b/rednose/helpers/__init__.py @@ -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)