diff --git a/compiler/debug.py b/compiler/debug.py index 191e1a06..9d6576fe 100644 --- a/compiler/debug.py +++ b/compiler/debug.py @@ -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") 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 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"