From 448f0ce488e8f440a62fcd1e469e7a46fb3177f0 Mon Sep 17 00:00:00 2001 From: Maarten Boersma Date: Wed, 24 Jun 2026 10:15:15 +0200 Subject: [PATCH] close version file after reading --- compiler/globals.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/globals.py b/compiler/globals.py index 54b7c197..be7f2ca7 100644 --- a/compiler/globals.py +++ b/compiler/globals.py @@ -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] \nUse -h for help.\n"