ethernet: use context manager to read generated LiteEth Verilog

This commit is contained in:
Fischer Moseley 2026-01-14 14:56:22 -07:00
parent 6aea352fba
commit a1c7d194e8
1 changed files with 2 additions and 5 deletions

View File

@ -664,8 +664,5 @@ def main(core_config):
builder = Builder(soc, compile_gateware=False, output_dir=path)
builder.build(build_name="liteeth_core")
file = open(path + "/gateware/liteeth_core.v")
data = file.read()
file.close()
return data
with open(path + "/gateware/liteeth_core.v") as f:
return f.read()