Merge pull request #297 from Aurora7913/close-filehandles

Fix python warnings about filehandles left open
This commit is contained in:
Matt Guthaus 2026-06-27 14:52:18 -04:00 committed by GitHub
commit c4e94f25d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -90,6 +90,7 @@ def log(str):
compile_log.write(line)
log.setup_output = []
compile_log.write(str + '\n')
compile_log.close()
else:
log.setup_output.append(str + "\n")

View File

@ -23,7 +23,8 @@ from openram import options
from openram import OPENRAM_HOME
VERSION = open(OPENRAM_HOME + "/../VERSION").read().rstrip()
with open(OPENRAM_HOME + "/../VERSION", "r", encoding="utf-8") as version_file:
VERSION = version_file.read().rstrip()
NAME = "OpenRAM v{}".format(VERSION)
USAGE = "sram_compiler.py [options] <config file>\nUse -h for help.\n"