From 2b0b878d72c74e3a335b346362eaa533c5459821 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Tue, 22 Feb 2022 01:39:49 +0530 Subject: Fix empty line lint_off crash issues --- src/maker/ModelGeneration.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/maker/ModelGeneration.py') diff --git a/src/maker/ModelGeneration.py b/src/maker/ModelGeneration.py index 0a6df82c..cbb268af 100755 --- a/src/maker/ModelGeneration.py +++ b/src/maker/ModelGeneration.py @@ -806,10 +806,12 @@ and set the load for input ports */ init_path = '' self.cur_dir = os.getcwd() - file = open(init_path + "library/tlv/lint_off.txt").readlines() wno = " " - for item in file: - wno += " -Wno-" + item.strip("\n") + with open(init_path + "library/tlv/lint_off.txt") as file: + for item in file.readlines(): + if item and item.strip(): + wno += " -Wno-" + item.strip("\n") + print("Running Verilator.............") os.chdir(self.modelpath) self.release_home = self.parser.get('NGHDL', 'RELEASE') -- cgit